From 4ed623d52ff73c70be739a476daa12f58ddf7e46 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Sun, 11 Jul 2021 03:26:23 +0430 Subject: switch between vim and tmux with c-w c-w. feels comfy. changed diasm into actual asm for c and c++ in the makefiles. some more things for vim. --- .tmux.conf | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to '.tmux.conf') diff --git a/.tmux.conf b/.tmux.conf index a5eadec..2df1ba3 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -65,6 +65,8 @@ bind -T off F6 \ wg_is_keys_off="#[fg=colour15,bg=colour63,bold]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'OFF')#[fg=colour22] #{?#{pane_ssh_connected},#[fg=colour63 bg=colour24],#[fg=colour63 bg=colour31]}#[default]" +# from christoomey's vim-tmux-nivagator +is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" #key bindings #do not use alt keybindings. because of the escape passed at the beginning of a alt keycode, #zsh's vim mode's escape becomes slow since tmux will have to wait on keybindings beginning with escape. @@ -74,6 +76,9 @@ bind -r k select-pane -U bind -r j select-pane -D bind -r h select-pane -L bind -r l select-pane -R +# bind -n C-w-w select-pane -l +bind-key -Ttable1 'C-w' if-shell "$is_vim" 'send-keys C-w' 'select-pane -l' +bind-key -Troot 'C-w' if-shell "$is_vim" 'send-keys C-w' 'switch-client -Ttable1' # bind -n S-Right next-window # bind -n S-Left previous-window bind -n C-k next-window @@ -82,10 +87,10 @@ bind -n C-j previous-window # bind -n M-Down select-pane -D # bind -n M-Left select-pane -L # bind -n M-Right select-pane -R -bind -r C-k select-pane -U -bind -r C-j select-pane -D -bind -r C-h select-pane -L -bind -r C-l select-pane -R +# bind -r C-k select-pane -U +# bind -r C-j select-pane -D +# bind -r C-h select-pane -L +# bind -r C-l select-pane -R setw -g mode-keys vi bind [ copy-mode bind -T copy-mode-vi 'v' send -X begin-selection -- cgit v1.2.3