diff options
Diffstat (limited to '.config/tmux')
| -rw-r--r-- | .config/tmux/tmux.conf | 61 |
1 files changed, 19 insertions, 42 deletions
diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index cc87163..6f48399 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -39,8 +39,12 @@ set -sg escape-time 10 #bind r source-file ~/.tmux.conf \; display "Reloaded!" bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded!" -# Use <Prefix>Ctrl+l to clear terminal -#bind C-l send-keys 'C-l' +# Use <Prefix>L to clear terminal +bind -r L send-keys 'C-l' + +# Rename current window (Ctrl + A, A) +bind R rename-window '' \; \ + command-prompt -I "#W" "rename-window -- '%%'" # Mouse set -g mouse on @@ -125,20 +129,10 @@ bind -n M-0 select-window -t :=0 # 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|l?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' - -# navigate across tmux-vim +# Navigate across tmux-vim is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" -bind -Troot C-w if-shell "$is_vim" "send-keys C-w" "switch-client -Tnav; refresh-client -S" - -bind -Tnav C-w send-keys 'C-w' # {{{ keybinds: select-pane bind -Tnav h select-pane -L bind h select-pane -L @@ -160,23 +154,7 @@ bind -Tnav p select-pane -l bind p select-pane -l bind -Tnav C-p select-pane -l bind C-p select-pane -l - -#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 - -# Change horizontal split <Prefix>% and Vertical split <Prefix>" to <Prefix>h and <Prefix>v respectively and change current working directory -#bind | split-window -h -c "#{pane_current_path}" -#bind - split-window -v -c "#{pane_current_path}" +# keybinds: select-pane }}} # {{{ keybinds: split-window bind -Tnav "\\" split-window -h -c "#{pane_current_path}" # vertical @@ -189,24 +167,23 @@ bind -Tnav "_" split-window -fv -c "#{pane_current_path}" # full horizontal bind "_" split-window -fv -c "#{pane_current_path}" # full horizontal # keybinds: split-window }}} -# Pane resizing, <Prefix> then shift + vi-directional keys, default is D,U,L,R -bind -r H resize-pane -L 20 -bind -r J resize-pane -D 20 -bind -r K resize-pane -U 20 -bind -r L resize-pane -R 20 - -# Pane resizing, <Prefix> then alt + vi-directional keys -bind-key M-j resize-pane -D 5 -bind-key M-k resize-pane -U 5 -bind-key M-h resize-pane -L 5 -bind-key M-l resize-pane -R 5 +# {{{ keybinds: resize-pane +bind -r -Tnav M-h resize-pane -L 10 +bind -r M-h resize-pane -L 10 +bind -r -Tnav M-j resize-pane -D 5 +bind -r M-j resize-pane -D 5 +bind -r -Tnav M-k resize-pane -U 5 +bind -r M-k resize-pane -U 5 +bind -r -Tnav M-l resize-pane -R 10 +bind -r M-l resize-pane -R 10 +# keybinds: resize-pane }}} # Hide a pane and bring it back with <Prefix>! and <Prefix>@ respectively bind-key ! break-pane -d -n _hidden_pane bind-key @ join-pane -s $.0 # Send Pane to another session/window -#bind-key j command-prompt -p "send pane to:" "join-pane -t '%%'" +bind-key = command-prompt -p "send pane to:" "join-pane -t '%%'" #―――――――――――――――――――――――――――――――――――――――――― |
