10 Commits

Author SHA1 Message Date
fb0d692489 update make file 2025-07-10 22:14:19 +01:00
Luis Freixial
9226005534 backup tmux 2025-07-10 22:06:39 +01:00
99dfae72b6 Merge pull request 'feat: Support tmux' (#4) from tmux into main
Reviewed-on: #4
2025-07-10 21:05:22 +00:00
d0c096047a support tmux 2025-07-10 22:04:38 +01:00
37deb3574f Merge pull request 'chore: change cat to batcat' (#3) from change-cat into main
Reviewed-on: #3
2025-07-10 20:59:03 +00:00
91ef3ea915 change cat to batcat 2025-07-10 21:58:28 +01:00
12f6aca914 Merge pull request 'update-zsh' (#2) from update-zsh into main
Reviewed-on: #2
2025-07-10 20:54:11 +00:00
Luis Freixial
8b49c1b8a5 update-zsh 2025-07-10 21:53:23 +01:00
c5472fc27b Merge pull request 'feat: Update git zsh with ones from ~' (#1) from update-zsh into main
Reviewed-on: #1
2025-07-10 20:49:15 +00:00
13ac3d78d1 update zsh with the ones from home dir 2025-07-10 21:45:43 +01:00
7 changed files with 167 additions and 9 deletions

View File

@@ -1,7 +1,33 @@
.PHONY: zsh
.PHONY: zsh update-zsh tmux update-tmux
zsh:
@for file in zsh/.[!.]*; do \
file=$${file#zsh/}; \
[ -f "$$HOME/$$file" ] && mv "$$HOME/$$file" "$$HOME/$$file.bak"; \
done && cp -r zsh/.[!.]* ~/ && echo "zsh files copied to home directory" || echo "zsh files not copied to home directory"
update-zsh:
@for file in zsh/.[!.]*; do \
base=$$(basename $$file); \
if [ -f "$$HOME/$$base" ]; then \
cp -v "$$HOME/$$base" "$$file"; \
fi \
done && echo "zsh files updated from home directory" || echo "zsh files not updated from home directory"
tmux:
@if [ -f "$$HOME/.tmux.conf" ]; then \
mv "$$HOME/.tmux.conf" "$$HOME/.tmux.conf.bak"; \
cp tmux/.tmux.conf "$$HOME/.tmux.conf"; \
echo ".tmux.conf copied to home directory"; \
else \
echo ".tmux.conf not found in home directory"; \
fi
update-tmux:
@if [ -f "$$HOME/.tmux.conf" ]; then \
cp "$$HOME/.tmux.conf" tmux/.tmux.conf; \
fi
@if [ -d "$$HOME/.tmux" ]; then \
cp -r $$HOME/.tmux/* tmux/.tmux/; \
fi
@echo "tmux files updated from home directory"

77
tmux/.tmux.conf Normal file
View File

@@ -0,0 +1,77 @@
set-option -sa terminal-overrides ",xterm*:Tc"
set -g mouse on
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# Vim style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Shift Alt vim keys to switch windows
bind -n M-H previous-window
bind -n M-L next-window
# --- Plugins ---
set -g @plugin 'tmux-plugins/tpm':
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -s default-terminal 'tmux-256color'
run ~/git-repos/dracula-tmux/dracula.tmux
set -g @dracula-time "Europe/Belfast,America/New_York"
set -g @dracula-time-military false
set -g @dracula-show-empty-plugins false
set -g @dracula-show-powerline true
set -g @dracula-fixed-location "Antrim"
set -g @dracula-show-flags true
set -g @dracula-show-left-icon session
set -g @dracula-show-fahrenheit false
set -g @dracula-show-edge-icons false
set -g @dracula-refresh-rate 5
set -g @dracula-show-left-icon "#H | #S "
set -g @dracula-git-disable-status true
set -g @dracula-git-show-repo-name true
set -g @dracula-show-ssh-only-when-connected true
set -g @dracula-plugins "git weather battery time ssh-session"
set -g status-position top
# set vi-mode
set-window-option -g mode-keys vi
# keybindings
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
bind n display-popup -E 'bash -i -c "read -p \"Session name: \" name; tmux new-session -d -s \$name && tmux switch-client -t \$name"'
bind j display-popup -E "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

View File

@@ -7,7 +7,6 @@ alias gcm='git checkout origin/main'
alias gce='git fetch && git pull && git commit --allow-empty -m "run-ci" && git push'
alias dcu='docker compose up -d'
alias dcub='docker compose up --build -d'
alias dcf='docker compose logs -f'
alias dcd='docker compose down'
alias dps='docker ps'
alias dk=docker_kill_fzf
@@ -20,4 +19,8 @@ alias ghl='gh pr list'
alias ghw='gh pr view --web'
alias prs='select_and_open_pr'
alias pr='select_and_open_pr_web_only'
alias e='exit
alias e='exit'
alias ta='tmux-attach'
alias tn='tmux-new'
alias tk='tmux-kill'
alias st='tmux source-file ~/.tmux.conf'

View File

@@ -1,2 +1,3 @@
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
alias f='selected=$(find . -type f 2>/dev/null | fzf --preview "batcat --style=numbers --color=always {}") && [ -n "$selected" ] && vim "$selected"'
alias cat='batcat'

View File

@@ -38,7 +38,6 @@ select_and_open_pr() {
if [[ -n "$pr_info" ]]; then
local pr_number=$(echo "$pr_info" | awk '{print $1}')
gh pr checkout "$pr_number"
gh pr view --web
else
echo "No PR selected."
fi
@@ -54,3 +53,46 @@ select_and_open_pr_web_only() {
echo "No PR selected."
fi
}
tmux-attach() {
local session
session=$(tmux ls -F "#{session_name}" 2>/dev/null | fzf)
[[ -n "$session" ]] && tmux attach -t "$session"
}
tmux-new() {
read "session?Enter new tmux session name: "
if [[ -z "$session" ]]; then
echo "No session name entered."
return 1
fi
if tmux has-session -t "$session" 2>/dev/null; then
echo "Session '$session' already exists."
return 1
fi
tmux new -s "$session"
}
tmux-kill() {
local session
session=$(tmux ls -F "#{session_name}" 2>/dev/null | fzf --prompt="Kill session: ")
[[ -n "$session" ]] && tmux kill-session -t "$session"
}
tmux_start_music() {
local session="music"
if ! tmux has-session -t "$session" 2>/dev/null; then
tmux new-session -d -s "$session"
tmux send-keys -t "$session":1 'clear' C-m
tmux split-window -v -t "$session":1 -p 8
tmux send-keys -t "$session":1.2 'spotify_player' C-m
tmux select-pane -t "$session":1.1
fi
tmux attach -t "$session"
}

View File

@@ -1,11 +1,13 @@
if [[ -f "/opt/homebrew/bin/brew" ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
export PATH="/Library/Developer/CommandLineTools/usr/bin:$PATH"
alias f='selected=$(find . -type f | fzf --preview "bat --style=numbers --color=always {}") && [ -n "$selected" ] && vim "$selected"'
alias ghostty_config='v $HOME/Library/Application\ Support/com.mitchellh.ghostty/config'
alias cat='bat'
export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"
#source $(brew --prefix powerlevel10k)/powerlevel10k.zsh-theme
export PATH="$PATH:/Users/luisfreixial/.cargo/bin"
#source $(brew --prefix powerlevel10k)/powerlevel10k.zsh-theme
export GOPATH=$HOME/go
export GOROOT="$(brew --prefix golang)/libexec"
alias python=/usr/bin/python3

View File

@@ -86,6 +86,11 @@ zle -N fzf-cd-widget
source ~/.zsh_exports
fi
# Secrets
if [ -f ~/.zsh_secrets ]; then
source ~/.zsh_secrets
fi
# OS-specific configurations
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [ -f ~/.zsh_debian ]; then
@@ -101,3 +106,5 @@ fi
eval "$(zoxide init --cmd cd zsh)"
eval "$(rbenv init -)"
eval "$(starship init zsh)"
eval "$(gh copilot alias -- zsh)"
eval "$(/Users/luisfreixial/.local/bin/mise activate zsh)"