fix(tmux): visible selection colour, mouse drag copies on release
- mode-style bg=yellow,fg=black (black on a dark terminal was invisible) - MouseDragEnd1Pane copies (pbcopy on macOS, tmux buffer elsewhere) without leaving copy-mode
This commit is contained in:
@@ -108,7 +108,9 @@ unbind p # (pasting)
|
|||||||
unbind % # (sp)
|
unbind % # (sp)
|
||||||
unbind '"' # (vs)
|
unbind '"' # (vs)
|
||||||
unbind-key -T copy-mode-vi MouseDragEnd1Pane # (mouse setting) {{{
|
unbind-key -T copy-mode-vi MouseDragEnd1Pane # (mouse setting) {{{
|
||||||
# disable "release mouse drag to copy and exit copy-mode"
|
# stock binding = "release the drag: copy AND leave copy-mode", which loses
|
||||||
|
# the selection on screen. Rebound below (clipboard section) as copy without
|
||||||
|
# leaving, so a drag is enough and y stays available.
|
||||||
# ref: https://github.com/tmux/tmux/issues/140
|
# ref: https://github.com/tmux/tmux/issues/140
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
@@ -142,9 +144,10 @@ bind -Tcopy-mode-vi 'v' send -X begin-selection # bind vi-like visual mode
|
|||||||
# Clipboard: pbcopy/pbpaste on macOS. Elsewhere tmux's own buffer, which tmux
|
# Clipboard: pbcopy/pbpaste on macOS. Elsewhere tmux's own buffer, which tmux
|
||||||
# also hands to the terminal through OSC 52 (set-clipboard), so it reaches the
|
# also hands to the terminal through OSC 52 (set-clipboard), so it reaches the
|
||||||
# local clipboard over ssh. xsel/xclip dropped: headless servers have no X.
|
# local clipboard over ssh. xsel/xclip dropped: headless servers have no X.
|
||||||
|
# Releasing a mouse drag copies too (selection kept on screen, copy-mode stays).
|
||||||
if-shell 'command -v pbcopy >/dev/null' \
|
if-shell 'command -v pbcopy >/dev/null' \
|
||||||
'bind -Tcopy-mode-vi y send -X copy-pipe-and-cancel pbcopy ; bind p run "pbpaste | tmux load-buffer - ; tmux paste-buffer"' \
|
'bind -Tcopy-mode-vi y send -X copy-pipe-and-cancel pbcopy ; bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-pipe-no-clear pbcopy ; bind p run "pbpaste | tmux load-buffer - ; tmux paste-buffer"' \
|
||||||
'bind -Tcopy-mode-vi y send -X copy-selection-and-cancel ; bind p paste-buffer'
|
'bind -Tcopy-mode-vi y send -X copy-selection-and-cancel ; bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-selection-no-clear ; bind p paste-buffer'
|
||||||
bind-key -Tcopy-mode-vi Escape send -X cancel # cancel v mode
|
bind-key -Tcopy-mode-vi Escape send -X cancel # cancel v mode
|
||||||
bind-key -Tcopy-mode-vi ^v send -X rectangle-toggle # cancel v mode
|
bind-key -Tcopy-mode-vi ^v send -X rectangle-toggle # cancel v mode
|
||||||
|
|
||||||
@@ -236,7 +239,7 @@ set -g @resurrect-dir "$XDG_CACHE_HOME/tmux/$TMUX_SOCKET_NAME"
|
|||||||
# Status Bar: {{{
|
# Status Bar: {{{
|
||||||
# ----------
|
# ----------
|
||||||
|
|
||||||
set -wg mode-style bg=black,fg=brightwhite
|
set -wg mode-style bg=yellow,fg=black # selection: same accent as the status bar
|
||||||
set-window-option -g window-status-separator ''
|
set-window-option -g window-status-separator ''
|
||||||
set -g status-position bottom
|
set -g status-position bottom
|
||||||
set -g status-left-length 42
|
set -g status-left-length 42
|
||||||
|
|||||||
Reference in New Issue
Block a user