From 8fbacc2fcfbe15583d792fa6eac0d3ac7e149d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=9Eahin=20Akkaya?= Date: Wed, 6 Apr 2022 22:12:21 +0300 Subject: [PATCH] Make tmux cycle back while changing panes --- .config/tmux/tmux.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index bad8329..66ad69a 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -8,13 +8,13 @@ unbind C-b # 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 } { if -F '#{pane_at_left}' { } { select-pane -L } +bind-key -n 'C-h' if-shell "$is_vim" { send-keys C-h } { if -F '#{pane_at_left}' { select-pane -L } { select-pane -L } } -bind-key -n 'C-j' if-shell "$is_vim" { send-keys C-j } { if -F '#{pane_at_bottom}' { } { select-pane -D } +bind-key -n 'C-j' if-shell "$is_vim" { send-keys C-j } { if -F '#{pane_at_bottom}' { select-pane -D } { select-pane -D } } -bind-key -n 'C-k' if-shell "$is_vim" { send-keys C-k } { if -F '#{pane_at_top}' { } { select-pane -U } +bind-key -n 'C-k' if-shell "$is_vim" { send-keys C-k } { if -F '#{pane_at_top}' { select-pane -U } { select-pane -U } } -bind-key -n 'C-l' if-shell "$is_vim" { send-keys C-l } { if -F '#{pane_at_right}' { } { select-pane -R } } +bind-key -n 'C-l' if-shell "$is_vim" { send-keys C-l } { if -F '#{pane_at_right}' { select-pane -R } { 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'"