I saw vi-mode implementation for fish shell, but I have no clue how to use it. Is there any tutorial available online describing basic functionality, e.g. how to switch modes?
Asked
Active
Viewed 5.2k times
2 Answers
185
In fish 2.3.0
and later:
- Run
fish_vi_key_bindings
to start vi mode - Run
fish_default_key_bindings
to go back to default mode
If you want to make it the default, add the fish_vi_key_bindings
command to ~/.config/fish/config.fish
.

hoijui
- 3,615
- 2
- 33
- 41

ridiculous_fish
- 17,273
- 1
- 54
- 61
-
1See [this issue](https://github.com/fish-shell/fish-shell/issues/2254) for how to setup a different vi esc key. Fish versions after 2.2.0 should let you do this via a `fish_user_key_bindings` function, but in the meantime I used the solution shown by the first post on that issue in my `config.fish`. – Jay Apr 06 '16 at 15:38
-
1To remove the annoying vi mode indicator (capital i for insert mode), override the fish_mode_prompt function. `alias -s fish_mode_prompt 'echo'` – Despertar Jun 26 '22 at 20:44
11
I am using fish 2.2.0. The following worked for me:
Edit $HOME/.config/fish/functions/fish_user_key_bindings.fish
function fish_user_key_bindings
fish_vi_key_bindings
end
via this

amit kumar
- 20,438
- 23
- 90
- 126
-
-
Its not related, as far as I know `zsh-vi-mode` is for zsh-shell not fish-shell – Dr Neo Sep 05 '22 at 13:05