From 0a7f9313f8128929dfc14bc69d89b16547cc6474 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Thu, 11 Apr 2019 13:12:38 +0100 Subject: [PATCH] Update .tmux.conf The mouse hacks for Tmux 2.1 are no longer needed, as most of the mouse features were added back in Tmux 2.2. Also the "tmux-better-mouse-mode" makes things better overall, and makes Tmux 2.1 scroll correctly too. --- tmux.conf | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/tmux.conf b/tmux.conf index 0b8df31..187866b 100644 --- a/tmux.conf +++ b/tmux.conf @@ -7,31 +7,12 @@ bind C-q send-prefix set -g default-terminal "screen-256color" set -g detach-on-destroy on set -g history-limit 50000 +set -g mouse on -# Mouse support (pre Tmux 2.1) -if-shell -b '[ "$(echo "$(tmux -V | cut -c 6-) < 2.1" | bc)" = 1 ]' \ - " \ - set -g mode-mouse on; \ - set -g mouse-resize-pane on; \ - set -g mouse-select-pane on; \ - set -g mouse-select-window on; \ - " - -# Mouse support (Tmux 2.1 and later) -# - scrolling behavior from: https://github.com/tmux/tmux/issues/145#issuecomment-151123624 -if-shell -b '[ "$(echo "$(tmux -V | cut -c 6-) >= 2.1" | bc)" = 1 ]' \ - " \ - 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; \ - " - -# Mac OS X fix for pbcopy, pbpaste, and launchctl. Requires: +# Pre-Tmux 2.6 macOS fix for pbcopy, pbpaste, and launchctl. Requires: # brew install reattach-to-user-namespace -if-shell -b '[ -n "$(command -v reattach-to-user-namespace)" ]' \ - " \ - set-option -g default-command 'reattach-to-user-namespace -l $SHELL'; \ - " +if-shell -b '[ "$(echo "$(tmux -V | cut -c 6-) < 2.6" | bc)" = 1 ] && [ -n "$(command -v reattach-to-user-namespace)" ]' \ + "set-option -g default-command 'reattach-to-user-namespace -l $SHELL'" # Set window notifications setw -g monitor-activity on @@ -89,9 +70,13 @@ set -g @plugin 'jimeh/tmux-themepack' set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-copycat' set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'nhdaly/tmux-better-mouse-mode' -# Set Theme +# Set Theme from tmux-themepack set -g @themepack 'powerline/default/green' +# Configure tmux-yank +set -g @yank_action 'copy-pipe' + # Init Plugin Manager run "${HOME}/.tmux/plugins/tpm/tpm"