summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kaufmann <astra@ionic.at>2020-03-22 05:45:17 +0100
committerDavid Kaufmann <astra@ionic.at>2020-03-22 05:45:17 +0100
commit72ed311cf75e86a0a13425779945eb503b1fcbd5 (patch)
tree40b9066fecb217634ce55ae3e82a9c6816b4045f
parent32df2cc6f3f766e17ff5a0df4881b5619e974fd5 (diff)
downloadconfig-72ed311cf75e86a0a13425779945eb503b1fcbd5.tar.gz
fix a lot of scrolling stuff in tmux
-rw-r--r--home/.tmux.conf26
1 files changed, 18 insertions, 8 deletions
diff --git a/home/.tmux.conf b/home/.tmux.conf
index 2f8aebd..8195fcc 100644
--- a/home/.tmux.conf
+++ b/home/.tmux.conf
@@ -40,20 +40,26 @@ set-option -g visual-silence off
# monitor-activity: bell on activity
set-window-option -g monitor-activity off
-# mouse options changed in v2.1
-# enable mouse support
-#set -g mouse on
-
+# enable mouse control by default, mouse options changed in v2.1
+#if-shell "if [[ `tmux -V | cut -d' ' -f2` -lt 2.1 ]]; then true; else false; fi" \
+ 'set -g mode-mouse on; set -g mouse-resize-pane on; set -g mouse-select-pane on; set -g mouse-select-window on'
+#if-shell "if [[ `tmux -V | cut -d' ' -f2` -eq 2.1 ]]; then true; else false; fi" \
+ 'set -g mouse on; set -g mouse-utf8 on'
# v2.2 has auto-utf8-detection
-#set-option -g utf8 on
-#set-option -g mouse-utf8 on
+#if-shell "if [[ `tmux -V | cut -d' ' -f2` -ge 2.2 ]]; then true; else false; fi" \
+ 'set -g mouse on'
+set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
+bind -n S-PPage copy-mode -eu
+
# enable Shift-PageUp/-PageDown
-#bind-key -t copy-mode-vi -n S-PPage halfpage-up
-#bind-key -t copy-mode-vi -n S-NPage halfpage-down
+bind-key -T copy-mode -n S-PPage send-keys -X halfpage-up
+bind-key -T copy-mode -n S-NPage send-keys -X halfpage-down
+bind-key -T copy-mode-vi -n S-PPage send-keys -X halfpage-up
+bind-key -T copy-mode-vi -n S-NPage send-keys -X halfpage-down
set-window-option -g aggressive-resize on
@@ -73,6 +79,10 @@ unbind-key -n M-Right
unbind-key -n M-Up
unbind-key -n M-Down
+# move current window left and right in the tab list, respectively.
+bind '<' swap-window -t -1
+bind '>' swap-window -t +1
+
# color options (panes)
set -g pane-border-style fg=black
set -g pane-active-border-style fg=brightred