diff --git a/config/tmux/plugins/tmux b/config/tmux/plugins/tmux new file mode 160000 index 0000000..9da7bb5 --- /dev/null +++ b/config/tmux/plugins/tmux @@ -0,0 +1 @@ +Subproject commit 9da7bb5e2e4caf57c1845f79b33e6f410dfdc548 diff --git a/config/tmux/plugins/tpm b/config/tmux/plugins/tpm new file mode 160000 index 0000000..99469c4 --- /dev/null +++ b/config/tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946 diff --git a/config/tmux/plugins/vim-tmux-navigator b/config/tmux/plugins/vim-tmux-navigator new file mode 160000 index 0000000..5b3c701 --- /dev/null +++ b/config/tmux/plugins/vim-tmux-navigator @@ -0,0 +1 @@ +Subproject commit 5b3c701686fb4e6629c100ed32e827edf8dad01e diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf new file mode 100644 index 0000000..42abf2d --- /dev/null +++ b/config/tmux/tmux.conf @@ -0,0 +1,82 @@ + +unbind r +bind r source-file ~/.config/tmux/tmux.conf + +set -g prefix M-s + +bind-key -n M-h select-pane -L +bind-key -n M-j select-pane -D +bind-key -n M-k select-pane -U +bind-key -n M-l select-pane -R + +set-option -g status-position top + +# List of plugins +set -g @plugin 'tmux-plugins/tpm' + + +set -g @plugin 'christoomey/vim-tmux-navigator' +# Other examples: +# set -g @plugin 'github_username/plugin_name' +# set -g @plugin 'github_username/plugin_name#branch' +# set -g @plugin 'git@github.com:user/plugin' +# set -g @plugin 'git@bitbucket.com:user/plugin' + +### Catppuccin tmux configs +set -g @plugin 'catppuccin/tmux' +set -g @catppuccin_window_left_separator "" +set -g @catppuccin_window_right_separator " " +set -g @catppuccin_window_middle_separator " █" +set -g @catppuccin_window_number_position "right" + +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 session" +set -g @catppuccin_status_left_separator " " +set -g @catppuccin_status_right_separator "" +set -g @catppuccin_status_fill "icon" +set -g @catppuccin_status_connect_separator "no" + +### END Catppuccin tmux configs + +set -g @catppuccin_directory_text "#{pane_current_path}" + + +### Meta key binding for navigation with nvim +### from https://github.com/christoomey/vim-tmux-navigator/issues/308 +unbind M-h +unbind M-j +unbind M-k +unbind M-l + +is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" +bind-key -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'select-pane -L' +bind-key -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'select-pane -D' +bind-key -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'select-pane -U' +bind-key -n 'M-l' if-shell "$is_vim" 'send-keys M-l' '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 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\' 'select-pane -l'" +if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ + "bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\\\' 'select-pane -l'" + +bind-key -T copy-mode-vi 'M-h' select-pane -L +bind-key -T copy-mode-vi 'M-j' select-pane -D +bind-key -T copy-mode-vi 'M-k' select-pane -U +bind-key -T copy-mode-vi 'M-l' select-pane -R +bind-key -T copy-mode-vi 'M-\' select-pane -l + +### END Meta key binding + + + + + + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.config/tmux/plugins/tpm/tpm'