changeset 1049:632e28eb77b2

feat: unmap tmux pane navigation shortcuts
author Zeger Van de Vannet <zeger@vandevan.net>
date Fri, 28 Jun 2024 15:37:25 +0200
parents c27e3816ab86
children 33ed4d4bba1d
files dot_tmux.conf
diffstat 1 files changed, 4 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/dot_tmux.conf	Thu Jun 13 20:48:00 2024 +0200
+++ b/dot_tmux.conf	Fri Jun 28 15:37:25 2024 +0200
@@ -41,9 +41,6 @@
 bind v split-window -h -c "#{pane_current_path}"
 bind c command-prompt -p "Name:" "new-window -c \"#{pane_current_path}\" -n %%"
 
-# Enable delete in command sequencer
-bind h send-keys 'c-h'
-
 # Open man pages in split
 bind @ command-prompt -p "Man:" "split-window -v 'exec man %%'"
 
@@ -58,19 +55,10 @@
 # Copy and Paste selection on middle mouse
 bind-key -T copy-mode-vi MouseDown2Pane send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
 
-# 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|n?vim?x?)(diff)?$'"
-bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h'  'select-pane -L'
-bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j'  'select-pane -D'
-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 h select-pane -L
+bind-key j select-pane -D
+bind-key k select-pane -U
+bind-key l select-pane -R
 
 bind-key -T copy-mode-vi 'C-h' select-pane -L
 bind-key -T copy-mode-vi 'C-j' select-pane -D