From 72ed311cf75e86a0a13425779945eb503b1fcbd5 Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Sun, 22 Mar 2020 05:45:17 +0100 Subject: fix a lot of scrolling stuff in tmux --- home/.tmux.conf | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'home') 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 -- cgit v1.2.3