chore(.tmux.conf): update terminal-features setting to 'XXX:RGB' for tmux configuration

chore(.tmux.conf): remove christoomey/vim-tmux-navigator plugin from plugin list
feat(.tmux.conf): add key bindings for VIM navigation in tmux
feat(.tmux.conf): add conditional key bindings based on tmux version for VIM navigation
feat(.tmux.conf): add key bindings for VIM navigation in copy-mode-vi
feat(.tmux.conf): add comments for VIM and TMUX Navigation sections in tmux.conf
This commit is contained in:
David Ibia
2024-10-01 15:06:18 +01:00
parent c591350038
commit a83185a398

View File

@@ -1,6 +1,6 @@
set -g mouse on set -g mouse on
bind r source-file ~/.tmux.conf bind r source-file ~/.tmux.conf
set-option -sa terminal-features ',xterm-kitty:RGB' set-option -a terminal-features 'XXX:RGB'
set-option -sg escape-time 10 set-option -sg escape-time 10
set-option -g focus-events on set-option -g focus-events on
set-window-option -g mode-keys vi set-window-option -g mode-keys vi
@@ -52,7 +52,6 @@ bind -r m resize-pane -Z
# List of plugins # List of plugins
set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'MunifTanjim/tmux-mode-indicator' set -g @plugin 'MunifTanjim/tmux-mode-indicator'
set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum' set -g @plugin 'tmux-plugins/tmux-continuum'
@@ -90,15 +89,32 @@ set -g @catppuccin_date_time_text "%H:%M"
# for neovim # for neovim
set -g @resurrect-strategy-nvim 'session' set -g @resurrect-strategy-nvim 'session'
set -g @continuum-restore 'on' set -g @continuum-restore 'on'
#
# set-window-option -g window-status-current-format '#[fg=red,bold]#[bg=default] #I #W #[fg=blue,bg=default]' # Is VIM?
# set-window-option -g window-status-format '#[fg=#ffffff,bold]#[bg=default] #I #W #[fg=default,bg=default]' # TMUX Navigation
#
# is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
# set -g status-left-length 20 | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf|pipenv)(diff)?$'"
# set -g status-position top bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
# set -g status-justify left bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
# set -g status-style bg=default bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-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 '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-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# #
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm' run '~/.tmux/plugins/tpm/tpm'