mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-25 12:21:14 -03:00
We no longer have two doc systems, move sphinx_doc_src back to doc_src
This commit is contained in:
58
doc_src/cmds/fish_hg_prompt.rst
Normal file
58
doc_src/cmds/fish_hg_prompt.rst
Normal file
@@ -0,0 +1,58 @@
|
||||
.. _cmd-fish_hg_prompt:
|
||||
|
||||
fish_hg_prompt - output Mercurial information for use in a prompt
|
||||
=================================================================
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
function fish_prompt
|
||||
echo -n (pwd)(fish_hg_prompt) '$ '
|
||||
end
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
The fish_hg_prompt function displays information about the current Mercurial repository, if any.
|
||||
|
||||
`Mercurial <https://www.mercurial-scm.org/>`_ (``hg``) must be installed.
|
||||
|
||||
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`` 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``
|
||||
|
||||
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 '!'
|
||||
|
||||
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 :ref:`fish_vcs_prompt <cmd-fish_vcs_prompt>`, which will call all supported version control prompt functions, including git, Mercurial and Subversion.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
A simple prompt that displays hg info::
|
||||
|
||||
function fish_prompt
|
||||
...
|
||||
printf '%s %s$' $PWD (fish_hg_prompt)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user