diff --git a/.tmux.conf b/.tmux.conf index b91f26f..e65dc0e 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -18,3 +18,51 @@ bind-key = kill-session set-option -sg escape-time 10 set-option -g focus-events on + +# Plugins +set -g @plugin 'tmux-plugins/tpm' + +#### Catppuccin theme +set -g @plugin 'catppuccin/tmux' +set -g @plugin 'tmux-plugins/tpm' +set -g @catppuccin_window_left_separator "█" +set -g @catppuccin_window_right_separator "█ " +set -g @catppuccin_window_number_position "right" +set -g @catppuccin_window_middle_separator " █" +set -g @catppuccin_window_default_fill "number" +set -g @catppuccin_window_default_text "#W" +set -g @catppuccin_window_current_fill "number" +set -g @catppuccin_window_current_text "*#W" +set -g @catppuccin_status_modules_right "directory application session " +set -g @catppuccin_status_left_separator " " +set -g @catppuccin_status_right_separator "" +set -g @catppuccin_status_right_separator_inverse "no" +set -g @catppuccin_status_fill "icon" +set -g @catppuccin_status_connect_separator "no" +set -g @catppuccin_directory_text "#{pane_current_path}" + +#### TMUX-Navigator +# set -g @plugin 'christoomey/vim-tmux-navigator' +# Smart pane switching with awareness of Vim splits. +# See: https://github.com/christoomey/vim-tmux-navigator +is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'" +bind-key -n 'C-m' if-shell "$is_vim" 'send-keys C-m' 'select-pane -L' +bind-key -n 'C-n' if-shell "$is_vim" 'send-keys C-n' 'select-pane -D' +bind-key -n 'C-e' if-shell "$is_vim" 'send-keys C-e' 'select-pane -U' +bind-key -n 'C-i' if-shell "$is_vim" 'send-keys C-i' 'select-pane -R' +tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' +if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" +if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" + +bind-key -T copy-mode-vi 'C-m' select-pane -L +bind-key -T copy-mode-vi 'C-n' select-pane -D +bind-key -T copy-mode-vi 'C-e' select-pane -U +bind-key -T copy-mode-vi 'C-i' select-pane -R +bind-key -T copy-mode-vi 'C-k' select-pane -l + + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm' diff --git a/fedora-dev.sh b/fedora-dev.sh index c24b258..49c2629 100644 --- a/fedora-dev.sh +++ b/fedora-dev.sh @@ -43,3 +43,5 @@ git clone https://github.com/noisycarlos/wezterm rm -r lazygit git clone https://github.com/noisycarlos/lazygit + +git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm diff --git a/ubuntu-dev.sh b/ubuntu-dev.sh index 38f90e3..868c23a 100644 --- a/ubuntu-dev.sh +++ b/ubuntu-dev.sh @@ -59,3 +59,4 @@ git clone https://github.com/noisycarlos/wezterm rm -r lazygit git clone https://github.com/noisycarlos/lazygit +git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm