FISH\_VI\_KEY\_BINDINGS(1) fish-shell FISH\_VI\_KEY\_BINDINGS(1)

# [NAME](#NAME)

fish\_vi\_key\_bindings - set vi key bindings for fish

# [SYNOPSIS](#SYNOPSIS)

```
fish_vi_key_bindings
fish_vi_key_bindings [--no-erase] [INIT_MODE]
```

# [DESCRIPTION](#DESCRIPTION)

**fish\_vi\_key\_bindings** sets the vi key bindings for **fish** shell.

If a valid *INIT\_MODE* is provided (insert, default, visual), then that mode will become the default . If no *INIT\_MODE* is given, the mode defaults to insert mode.

The following parameters are available:

[**--no-erase**](#no)

Does not clear previous set bindings

Further information on how to use vi mode &lt;#vi-mode&gt;.

# [DIFFERENCES FROM VIM](#DIFFERENCES_FROM_VIM)

fish's vi mode aims to be familiar to vim users, but there are some differences:

[**Word character handling**](#Word)

In vim, underscore (**\_**) is treated as a keyword character by default, so word motions like **w**, **b**, and **e** treat **foo\_bar** as a single word. In fish, underscore is treated as punctuation, so word motions stop at underscores. For example, pressing **w** on **foo\_bar** in fish stops at the **\_**, while in vim it would jump past the entire identifier.

# [EXAMPLES](#EXAMPLES)

To start using vi key bindings:

```
fish_vi_key_bindings
```

or **set -g fish\_key\_bindings fish\_vi\_key\_bindings** in config.fish &lt;#configuration&gt;.

# [Copyright](#Copyright)

fish-shell developers

October 26, 2026 4.9

---

Document: fish_vi_key_bindings(1) from fish 4.9.3-r4 (Chainguard OS)
Source: https://github.com/fish-shell/fish-shell
