Skip to content

Commit 836ee93

Browse files
committed
Vi bindings: Control-N to accept autosuggestion
One of the things that keep me from using Vi mode is that it doesn't define an insert-mode shortcut to accept autosuggestions. Let's use Control-N because that Vim key is the closest equivalent. Closes fish-shell#10339
1 parent b3c610f commit 836ee93

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

share/functions/fish_vi_key_bindings.fish

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
104104
bind -s --preset e forward-single-char forward-word backward-char
105105
bind -s --preset E forward-single-char forward-bigword backward-char
106106

107+
bind -s --preset -M insert \cn accept-autosuggestion
108+
107109
# Vi/Vim doesn't support these keys in insert mode but that seems silly so we do so anyway.
108110
bind -s --preset -M insert -k home beginning-of-line
109111
bind -s --preset -M default -k home beginning-of-line

0 commit comments

Comments
 (0)