tmux: Use <Esc> to clear selection and cancel

Use <Esc> to clear the selection and cancel copy-mode depending on if
something is selected.
This commit is contained in:
2022-06-24 17:20:20 +02:00
parent b4e0d4111b
commit 79e34c3e4f

View File

@@ -64,6 +64,9 @@ bind-key -T copy-mode-vi v send-keys -X begin-selection
# Yank into system clipboard
bind-key -T copy-mode-vi y send-keys -X copy-pipe "xclip -selection clipboard"
# Clear selection or cancel copy-mode when nothing is selected
bind -T copy-mode-vi Escape if -F "#{selection_present}" { send -X clear-selection } { send -X cancel }
# Navigate panes with <prefix>-[hjkl]
# NOTE: C-[hjkl] (w/o prefix) moves through vim splits and tmux panes
# See vim-tmux-navigator