aboutsummaryrefslogtreecommitdiff
path: root/.config/tmux
diff options
context:
space:
mode:
Diffstat (limited to '.config/tmux')
-rw-r--r--.config/tmux/tmux.conf24
1 files changed, 24 insertions, 0 deletions
diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf
index 8275422..2afb8a0 100644
--- a/.config/tmux/tmux.conf
+++ b/.config/tmux/tmux.conf
@@ -18,6 +18,8 @@ bind C-s send-prefix
# Send the prefix to client inside window (nested tmux)
#bind-key -n C-a send-prefix
+is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
+bind -n C-a if-shell "$is_vim" "send-keys C-a" "send-prefix"
# Disable local tmux keys (nested tmux)
bind -T root F12 \
@@ -45,6 +47,9 @@ bind -r L send-keys 'C-l'
bind R rename-window '' \; \
command-prompt -I "#W" "rename-window -- '%%'"
+# Renumber all windows when one is killed
+set -g renumber-windows on
+
# Mouse
set -g mouse on
#set -g mouse-select-pane on
@@ -57,6 +62,25 @@ set -g mouse on
# Sane scrolling
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
+# Sane scrolling
+set -g terminal-overrides 'xterm*:smcup@:rmcup@'
+bind -n WheelUpPane {
+ if -F '#{==:#{window_name},nvim}' {
+ #send-keys -M
+ send-keys Up
+ } {
+ copy-mode -e
+ }
+}
+bind -n WheelDownPane {
+ if -F '#{==:#{window_name},nvim}' {
+ #send-keys -M
+ send-keys Down
+ } {
+ copy-mode -e
+ }
+}
+
# Shift up/down copy-mode without prefix
bind-key -n S-Up copy-mode \; send-key Up
bind-key -n S-Down copy-mode \; send-key Down