From 022f42c3cd1539f1c81340394145bd0cc7143412 Mon Sep 17 00:00:00 2001 From: Sergei Shilovsky Date: Wed, 5 Oct 2022 23:11:43 +0300 Subject: [PATCH] Update $fish_cursor_selection_mode in vi/default bindings Introduced with 3.6.0 `fish_cursor_selection_mode` variable breaks existing vi bindings (for example, input sequence `abc0vd` doesn't delete the `a` character as would be expected). This patch fixes it by switching `fish_cursor_selection_mode` to `inclusive` and back. --- share/functions/fish_default_key_bindings.fish | 2 ++ share/functions/fish_vi_key_bindings.fish | 1 + 2 files changed, 3 insertions(+) diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish index 68e676e3f..1c976117f 100644 --- a/share/functions/fish_default_key_bindings.fish +++ b/share/functions/fish_default_key_bindings.fish @@ -104,4 +104,6 @@ function fish_default_key_bindings -d "emacs-like key binds" # the following to tell a console to paste: bind --preset $argv \e\x20ep fish_clipboard_paste end + + set -e -g fish_cursor_selection_mode end diff --git a/share/functions/fish_vi_key_bindings.fish b/share/functions/fish_vi_key_bindings.fish index 8987e0fa5..2ca0c9474 100644 --- a/share/functions/fish_vi_key_bindings.fish +++ b/share/functions/fish_vi_key_bindings.fish @@ -305,6 +305,7 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish' # After executing once, this will have defined functions listening for the variable. # Therefore it needs to be before setting fish_bind_mode. fish_vi_cursor + set -g fish_cursor_selection_mode inclusive set fish_bind_mode $init_mode