fish-shell/doc_src/fish_mode_prompt.txt

38 lines
1.2 KiB
Text
Raw Normal View History

2016-06-21 17:06:44 +00:00
\section fish_mode_prompt fish_mode_prompt - define the appearance of the mode indicator
\subsection fish_mode_prompt-synopsis Synopsis
2017-06-29 00:09:54 +00:00
The fish_mode_prompt function will output the mode indicator for use in vi-mode.
2016-06-21 17:06:44 +00:00
\subsection fish_mode_prompt-description Description
2017-06-29 00:09:54 +00:00
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. You can also define an empty `fish_mode_prompt` function to remove the Vi mode indicators. The `$fish_bind_mode variable` can be used to determine the current mode. It
will be one of `default`, `insert`, `replace_one`, or `visual`.
2016-06-21 17:06:44 +00:00
2017-06-29 00:09:54 +00:00
\subsection block-example Example
\fish
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 visual
set_color --bold brmagenta
echo 'V'
case '*'
set_color --bold red
echo '?'
end
set_color normal
end
\endfish
Outputting multiple lines is not supported in `fish_mode_prompt`.