diff --git a/.tmux.conf b/.tmux.conf index e41d2b1..d969d22 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -16,7 +16,6 @@ set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-continuum' set -g @plugin 'tmux-plugins/tmux-cpu' set -g @plugin 'tmux-plugins/tmux-pain-control' -set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'tmux-plugins/tmux-net-speed' set -g @plugin 'tmux-plugins/tmux-copycat' set -g @plugin 'tmux-plugins/tmux-prefix-highlight' @@ -73,10 +72,15 @@ set -g @batt_color_charging "#[fg=colour033]" set -g @net_speed_format "󰁆 %8s 󰁞 %8s" -set -g @yank_selection 'clipboard' # or 'primary' or 'secondary' -set -g @yank_selection_mouse 'clipboard' # or 'primary' or 'secondary' -set -g @yank_action 'copy-pipe' # or 'copy-pipe-and-cancel' for the default -set -g @yank_with_mouse on # or 'off' +## Copy paste settings +## https://github.com/tmux/tmux/wiki/Clipboard +set -g mode-keys vi +set -g set-clipboard external +set -s copy-command 'xsel -i --clipboard' +bind -T copy-mode-vi 'v' send -X begin-selection +bind -T copy-mode-vi 'y' send -X copy-pipe +bind -T copy-mode C-c send -X copy-pipe-no-clear +bind -T copy-mode-vi C-c send -X copy-pipe-no-clear # Sensible: Fix the colors. #set -g default-terminal "xterm-256color" @@ -168,10 +172,6 @@ set -g focus-events on run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')" run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')" -## Sensible: Vi copypaste mode, makes more sense even to us Vim users. -# set-option -g mode-keys emacs -if-shell "test '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 4 \)'" 'bind-key -Tcopy-mode-vi v send -X begin-selection; bind-key -Tcopy-mode-vi y send -X copy-selection-and-cancel' - # Remove mouse mode fail. if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 1\)' 'set -g mouse off'