Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use vi mode in fish shell? [closed]

Tags:

vim

vi

fish

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?

like image 948
sandric Avatar asked Feb 11 '15 00:02

sandric


People also ask

How do I enable vi mode in fish?

To enable vi mode, use fish_vi_key_bindings . When in vi-mode, the fish_mode_prompt function will display a mode indicator to the left of the prompt.

How do I enable vi mode in bash?

The bash shell (again, via GNU Readline) is able to provide this functionality for us. In order to enable it, you run the command $ set -o vi.

How do I set the default shell on my fish?

If you wish to use fish (or any other shell) as your default shell, you need to enter your new shell's executable /usr/local/bin/fish in two places: add /usr/local/bin/fish to /etc/shells. change your default shell with chsh -s to /usr/local/bin/fish.


1 Answers

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.

like image 89
ridiculous_fish Avatar answered Oct 07 '22 21:10

ridiculous_fish