From 836ee93617bfb1d2d1f9d96dfd728a6a1829d488 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 2 Mar 2024 10:53:12 +0100 Subject: [PATCH] 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 #10339 --- share/functions/fish_vi_key_bindings.fish | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/functions/fish_vi_key_bindings.fish b/share/functions/fish_vi_key_bindings.fish index 42c19e749..9c8b89bcd 100644 --- a/share/functions/fish_vi_key_bindings.fish +++ b/share/functions/fish_vi_key_bindings.fish @@ -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