mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
fish_bind_mode variable documentation
This commit is contained in:
parent
dd191a9d4b
commit
eaa0fdaeba
1 changed files with 29 additions and 3 deletions
|
@ -2,10 +2,36 @@
|
||||||
|
|
||||||
\subsection fish_mode_prompt-synopsis Synopsis
|
\subsection fish_mode_prompt-synopsis Synopsis
|
||||||
|
|
||||||
fish_mode_prompt will output the mode indicator for use in vi-mode.
|
The fish_mode_prompt function will output the mode indicator for use in vi-mode.
|
||||||
|
|
||||||
\subsection fish_mode_prompt-description Description
|
\subsection fish_mode_prompt-description Description
|
||||||
|
|
||||||
The output of `fish_mode_prompt` will be displayed in the mode indicator position to the left of the regular prompt.
|
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`.
|
||||||
|
|
||||||
Multiple lines are not supported in `fish_mode_prompt`.
|
\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`.
|
||||||
|
|
Loading…
Reference in a new issue