mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 20:33:08 +00:00
Document fish_mode_prompt
This commit is contained in:
parent
0f3b4d2bd8
commit
a3e9e179eb
2 changed files with 17 additions and 0 deletions
11
doc_src/fish_mode_prompt.txt
Normal file
11
doc_src/fish_mode_prompt.txt
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
\section fish_mode_prompt fish_mode_prompt - define the appearance of the mode indicator
|
||||||
|
|
||||||
|
\subsection fish_mode_prompt-synopsis Synopsis
|
||||||
|
|
||||||
|
fish_mode_prompt will output the mode indicator for use in vi-mode.
|
||||||
|
|
||||||
|
\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.
|
||||||
|
|
||||||
|
Multiple lines are not supported in `fish_mode_prompt`.
|
|
@ -1012,6 +1012,8 @@ You can change these key bindings using the <a href="commands.html#bind">bind</a
|
||||||
|
|
||||||
Vi mode allows for the use of Vi-like commands at the prompt. Initially, <a href="#vi-mode-insert">insert mode</a> is active. @key{Escape} enters <a href="#vi-mode-command">command mode</a>. The commands available in command, insert and visual mode are described below. Vi mode builds on top of <a href="#emacs-mode">Emacs mode</a>, so all keybindings mentioned there that do not contradict the ones mentioned here also work.
|
Vi mode allows for the use of Vi-like commands at the prompt. Initially, <a href="#vi-mode-insert">insert mode</a> is active. @key{Escape} enters <a href="#vi-mode-command">command mode</a>. The commands available in command, insert and visual mode are described below. Vi mode builds on top of <a href="#emacs-mode">Emacs mode</a>, so all keybindings mentioned there that do not contradict the ones mentioned here also work.
|
||||||
|
|
||||||
|
When in vi-mode, the <a href="fish_mode_prompt.html">`fish_mode_prompt`</a> function will display a mode indicator to the left of the prompt. The `fish_vi_cursor` function is available to change the cursor's shape depending on the mode in supported terminals.
|
||||||
|
|
||||||
\subsubsection vi-mode-command Command mode
|
\subsubsection vi-mode-command Command mode
|
||||||
|
|
||||||
Command mode is also known as normal mode.
|
Command mode is also known as normal mode.
|
||||||
|
@ -1200,6 +1202,10 @@ function fish_title
|
||||||
end
|
end
|
||||||
\endfish
|
\endfish
|
||||||
|
|
||||||
|
\subsection prompt Programmable prompt
|
||||||
|
|
||||||
|
When fish waits for input, it will display a prompt by evaluating the `fish_prompt` and `fish_right_prompt` functions. The output of the former is displayed on the left and the latter's output on the right side of the terminal. The output of `fish_mode_prompt` will be prepended on the left, though the default function only does this when in <a href="index.html#vi-mode">vi-mode</a>.
|
||||||
|
|
||||||
\subsection greeting Configurable greeting
|
\subsection greeting Configurable greeting
|
||||||
|
|
||||||
If a function named `fish_greeting` exists, it will be run when entering interactive mode. Otherwise, if an environment variable named `fish_greeting` exists, it will be printed.
|
If a function named `fish_greeting` exists, it will be run when entering interactive mode. Otherwise, if an environment variable named `fish_greeting` exists, it will be printed.
|
||||||
|
|
Loading…
Reference in a new issue