From ff536a5b46b52ae62448c8e69eebeeb7dc119761 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sun, 22 Oct 2023 20:24:41 +0200 Subject: Testing nested tmux session settings --- .config/tmux/tmux.conf | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 933c9b5..6b3ad73 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -40,7 +40,7 @@ set -sg escape-time 10 bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded!" # Use Ctrl+l to clear terminal -bind C-l send-keys 'C-l' +#bind C-l send-keys 'C-l' # Mouse set -g mouse on @@ -132,18 +132,24 @@ 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' +# Bind "Ctrl+hjkl" to navigate between panes in the nested session +bind -Tnav -n C-h select-pane -L +bind -Tnav -n C-j select-pane -D +bind -Tnav -n C-k select-pane -U +bind -Tnav -n 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'" -# Copy Mode vi-directional keys -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 +## Copy Mode vi-directional keys +#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 # Change horizontal split % and Vertical split " to h and v respectively and change current working directory bind | split-window -h -c "#{pane_current_path}" -- cgit v1.2.3