docs: update the VCS prompt function documentation

Edited for clarity and formatting.

[ci skip]
This commit is contained in:
David Adam
2019-04-11 23:51:00 +08:00
parent c50eb7c85f
commit 87518a524f
4 changed files with 111 additions and 118 deletions

View File

@@ -1,40 +1,40 @@
.. _cmd-fish_hg_prompt:
fish_hg_prompt - output mercurial information for use in a prompt
fish_hg_prompt - output Mercurial information for use in a prompt
=================================================================
Description
-----------
The fish_hg_prompt function can be used to display information about the current mercurial repository, if any.
The fish_hg_prompt function displays information about the current Mercurial repository, if any.
For obvious reasons, it requires having hg installed.
`Mercurial <https://www.mercurial-scm.org/>`_ (``hg``) must be installed.
There are numerous configuration options:
There are numerous customization options, which can be controlled with fish variables.
- $fish_color_hg_clean, $fish_color_hg_modified and $fish_color_hg_dirty: The color to use when the repo has the respective status
- ``$fish_color_hg_clean``, ``$fish_color_hg_modified`` and ``$fish_color_hg_dirty`` are colors used when the repository has the respective status.
Some colors for status symbols:
- $fish_color_hg_added
- $fish_color_hg_renamed
- $fish_color_hg_copied
- $fish_color_hg_deleted
- $fish_color_hg_untracked
- $fish_color_hg_unmerged
- ``$fish_color_hg_added``
- ``$fish_color_hg_renamed``
- ``$fish_color_hg_copied``
- ``$fish_color_hg_deleted``
- ``$fish_color_hg_untracked``
- ``$fish_color_hg_unmerged``
And the status symbols themselves:
The status symbols themselves:
- $fish_prompt_hg_status_added, default '✚'
- $fish_prompt_hg_status_modified, default '*'
- $fish_prompt_hg_status_copied, default '⇒'
- $fish_prompt_hg_status_deleted, default '✖'
- $fish_prompt_hg_status_untracked, default '?'
- $fish_prompt_hg_status_unmerged, default '!'
- ``$fish_prompt_hg_status_added``, default '✚'
- ``$fish_prompt_hg_status_modified``, default '*'
- ``$fish_prompt_hg_status_copied``, default '⇒'
- ``$fish_prompt_hg_status_deleted``, default '✖'
- ``$fish_prompt_hg_status_untracked``, default '?'
- ``$fish_prompt_hg_status_unmerged``, default '!'
And $fish_prompt_hg_status_order, which can be used to change the order the status symbols appear in. It defaults to ``added modified copied deleted untracked unmerged``.
Finally, ``$fish_prompt_hg_status_order``, which can be used to change the order the status symbols appear in. It defaults to ``added modified copied deleted untracked unmerged``.
See also fish_vcs_prompt, which will call all supported vcs-prompt functions, including git, hg and svn.
See also :ref:`fish_vcs_prompt <cmd-fish_vcs_prompt>`, which will call all supported version control prompt functions, including git, Mercurial and Subversion.
Example
-------