From c5e535e794c087e2d8084a841e7c444dde866003 Mon Sep 17 00:00:00 2001 From: David Adam Date: Sat, 6 Jun 2020 22:52:07 +0800 Subject: [PATCH] docs: link and explicit instructions on creating a blank fish_mode_prompt Work on #5783. [ci skip] --- doc_src/cmds/bind.rst | 2 +- doc_src/cmds/fish_mode_prompt.rst | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc_src/cmds/bind.rst b/doc_src/cmds/bind.rst index b141442fe..dbce9f29d 100644 --- a/doc_src/cmds/bind.rst +++ b/doc_src/cmds/bind.rst @@ -164,7 +164,7 @@ The following special input functions are available: - ``repaint`` reexecutes the prompt functions and redraws the prompt. Multiple successive repaints are coalesced. -- ``repaint-mode`` reexecutes the fish_mode_prompt function and redraws the prompt. This is useful for vi-mode. If no fish_mode_prompt exists, it acts like a normal repaint. +- ``repaint-mode`` reexecutes the :ref:`fish_mode_prompt ` and redraws the prompt. This is useful for vi-mode. If no ``fish_mode_prompt`` exists, it acts like a normal repaint. - ``self-insert``, inserts the matching sequence into the command line diff --git a/doc_src/cmds/fish_mode_prompt.rst b/doc_src/cmds/fish_mode_prompt.rst index 322e26316..d5ab35655 100644 --- a/doc_src/cmds/fish_mode_prompt.rst +++ b/doc_src/cmds/fish_mode_prompt.rst @@ -18,10 +18,14 @@ 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. 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``. +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``, or ``visual``. -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 (:ref:`fish_prompt ` and :ref:`fish_right_prompt `) will be executed as well in case they contain a mode display. +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 (:ref:`fish_prompt ` and :ref:`fish_right_prompt `) will be executed as well in case they contain a mode display. Example -------