From 79e34c3e4f9f5d3ac973483211b663aa18990355 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Fri, 24 Jun 2022 17:20:20 +0200 Subject: [PATCH] tmux: Use to clear selection and cancel Use to clear the selection and cancel copy-mode depending on if something is selected. --- .config/tmux/tmux.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 7842429..48a1453 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -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 -[hjkl] # NOTE: C-[hjkl] (w/o prefix) moves through vim splits and tmux panes # See vim-tmux-navigator