FISH\_MODE\_PROMPT(1) fish-shell FISH\_MODE\_PROMPT(1)

# [NAME](#NAME)

fish\_mode\_prompt - define the appearance of the mode indicator

# [SYNOPSIS](#SYNOPSIS)

```
fish_mode_prompt
```

```
function fish_mode_prompt


     echo -n "$fish_bind_mode "
end
```

# [DESCRIPTION](#DESCRIPTION)

The **fish\_mode\_prompt** function outputs the mode indicator for use in vi mode.

The default **fish\_mode\_prompt** function will output indicators about the current vi editor mode displayed to the left of the regular prompt. Define your own function to customize the appearance of the mode indicator. The **$fish\_bind\_mode** variable can be used to determine the current mode. It will be one of **default**, **insert**, **replace\_one**, **replace**, **visual**, or **operator**.

You can also define an empty **fish\_mode\_prompt** function to remove the vi mode indicators:

```
function fish_mode_prompt; end
funcsave fish_mode_prompt
```

**fish\_mode\_prompt** will be executed when the vi mode changes. If it produces any output, it is displayed and used. If it does not, the other prompt functions (fish\_prompt &lt;&gt; and fish\_right\_prompt &lt;&gt;) will be executed as well in case they contain a mode display.

If **fish\_transient\_prompt** &lt;#envvar-fish\_transient\_prompt&gt; is set to 1, **fish\_mode\_prompt --final-rendering** is run before executing the commandline.

# [EXAMPLE](#EXAMPLE)

```
function fish_mode_prompt


  switch $fish_bind_mode


    case default


      set_color --bold red


      echo 'N'


    case insert


      set_color --bold green


      echo 'I'


    case replace_one


      set_color --bold green


      echo 'R'


    case replace


      set_color --bold bryellow


      echo 'R'


    case visual


      set_color --bold brmagenta


      echo 'V'


    case operator f F t T


      set_color --bold cyan


      echo 'N'


    case '*'


      set_color --bold red


      echo '?'


  end


  set_color --reset
end
```

Outputting multiple lines is not supported in **fish\_mode\_prompt**.

# [Copyright](#Copyright)

fish-shell developers

October 12, 2026 4.9

---

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