From a3e9e179eb51476f3c700e485268db45d367f408 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 21 Jun 2016 19:06:44 +0200 Subject: [PATCH] Document fish_mode_prompt --- doc_src/fish_mode_prompt.txt | 11 +++++++++++ doc_src/index.hdr.in | 6 ++++++ 2 files changed, 17 insertions(+) create mode 100644 doc_src/fish_mode_prompt.txt diff --git a/doc_src/fish_mode_prompt.txt b/doc_src/fish_mode_prompt.txt new file mode 100644 index 000000000..b35d4ce4a --- /dev/null +++ b/doc_src/fish_mode_prompt.txt @@ -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`. diff --git a/doc_src/index.hdr.in b/doc_src/index.hdr.in index a25bf4c59..49d8552de 100644 --- a/doc_src/index.hdr.in +++ b/doc_src/index.hdr.in @@ -1012,6 +1012,8 @@ You can change these key bindings using the bindinsert mode is active. @key{Escape} enters command mode. The commands available in command, insert and visual mode are described below. Vi mode builds on top of Emacs mode, so all keybindings mentioned there that do not contradict the ones mentioned here also work. +When in vi-mode, the `fish_mode_prompt` 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 Command mode is also known as normal mode. @@ -1200,6 +1202,10 @@ function fish_title end \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 vi-mode. + \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.