aboutsummaryrefslogtreecommitdiff
path: root/.config/tmux/tmux.conf
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2023-10-22 20:33:57 +0200
committersrdusr <trevorgray@srdusr.com>2023-10-22 20:33:57 +0200
commit1f8fc92879b87cd3b74d5732035b3f1d819f3d52 (patch)
tree2e54bd9b971e380b7ee7c6289fdafc7639645115 /.config/tmux/tmux.conf
parenta20738fda2e122720d03bb796455c3206febbeb1 (diff)
downloaddotfiles-1f8fc92879b87cd3b74d5732035b3f1d819f3d52.tar.gz
dotfiles-1f8fc92879b87cd3b74d5732035b3f1d819f3d52.zip
Testing nested tmux session settings
Diffstat (limited to '.config/tmux/tmux.conf')
-rw-r--r--.config/tmux/tmux.conf34
1 files changed, 26 insertions, 8 deletions
diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf
index 15606e2..cc87163 100644
--- a/.config/tmux/tmux.conf
+++ b/.config/tmux/tmux.conf
@@ -125,13 +125,20 @@ 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)?$'"
+#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
+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
@@ -154,11 +161,11 @@ 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'"
+#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
@@ -168,8 +175,19 @@ if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
#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}"
+#bind | split-window -h -c "#{pane_current_path}"
+#bind - split-window -v -c "#{pane_current_path}"
+
+# {{{ keybinds: split-window
+bind -Tnav "\\" split-window -h -c "#{pane_current_path}" # vertical
+bind "\\" split-window -h -c "#{pane_current_path}" # vertical
+bind -Tnav "|" split-window -fh -c "#{pane_current_path}" # full vertical
+bind "|" split-window -fh -c "#{pane_current_path}" # full vertical
+bind -Tnav "-" split-window -v -c "#{pane_current_path}" # horizontal
+bind "-" split-window -v -c "#{pane_current_path}" # horizontal
+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