Skip to content

Commit

Permalink
Vi bindings: Control-N to accept autosuggestion
Browse files Browse the repository at this point in the history
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 #10339
  • Loading branch information
krobelus committed Mar 9, 2024
1 parent b3c610f commit 836ee93
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions share/functions/fish_vi_key_bindings.fish
Expand Up @@ -104,6 +104,8 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
bind -s --preset e forward-single-char forward-word backward-char
bind -s --preset E forward-single-char forward-bigword backward-char

bind -s --preset -M insert \cn accept-autosuggestion

# Vi/Vim doesn't support these keys in insert mode but that seems silly so we do so anyway.
bind -s --preset -M insert -k home beginning-of-line
bind -s --preset -M default -k home beginning-of-line
Expand Down

0 comments on commit 836ee93

Please sign in to comment.