aboutsummaryrefslogtreecommitdiffstats
path: root/.tmux.conf
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2021-07-10 22:56:23 +0000
committerterminaldweller <thabogre@gmail.com>2021-07-10 22:56:23 +0000
commit4ed623d52ff73c70be739a476daa12f58ddf7e46 (patch)
tree0e11c7efa44dee99f5efaf0ebcac80087d3fec80 /.tmux.conf
parentupdate (diff)
downloadscripts-4ed623d52ff73c70be739a476daa12f58ddf7e46.tar.gz
scripts-4ed623d52ff73c70be739a476daa12f58ddf7e46.zip
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.
Diffstat (limited to '')
-rw-r--r--.tmux.conf13
1 files changed, 9 insertions, 4 deletions
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