From 6d0113879707c2ebcf676d67fff4ec3eeadf58ba Mon Sep 17 00:00:00 2001 From: Simon Olofsson Date: Wed, 4 Feb 2026 10:05:37 +0100 Subject: [PATCH] Fix vi key bindings regression when called with argument Commit bbb2f0de8d added a ctrl-right binding to override the shared binding with forward-word-vi for vi-compliance. However, it incorrectly passed $argv which caused the error: "bind: cannot parse key 'default'" when calling fish_vi_key_bindings with a mode argument like: fish_vi_key_bindings "default" Fix that. Co-Authored-By: Johannes Altmanninger Closes #12413 --- share/functions/fish_vi_key_bindings.fish | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/share/functions/fish_vi_key_bindings.fish b/share/functions/fish_vi_key_bindings.fish index 4e1530a5f..03d877ded 100644 --- a/share/functions/fish_vi_key_bindings.fish +++ b/share/functions/fish_vi_key_bindings.fish @@ -267,6 +267,8 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish' # Do this first so vi-bindings win over default. for mode in insert default visual __fish_shared_key_bindings -s -M $mode + __fish_per_os_bind --preset -M $mode ctrl-right forward-token forward-word-vi + # ctrl-left is same as emacs mode end # Add a way to switch from insert to normal (command) mode. @@ -349,9 +351,6 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish' bind -s --preset ] history-token-search-forward bind -s --preset -m insert / history-pager repaint-mode - __fish_per_os_bind --preset $argv ctrl-right forward-token forward-word-vi - # ctrl-left is same as emacs mode - bind -s --preset -M insert ctrl-n accept-autosuggestion # Vi/Vim doesn't support these keys in insert mode but that seems silly so we do so anyway.