2019-03-31 17:05:09 +08:00
|
|
|
.. _cmd-fish_vcs_prompt:
|
|
|
|
|
2019-02-25 08:20:25 +08:00
|
|
|
fish_vcs_prompt - output vcs information for use in a prompt
|
|
|
|
============================================================
|
|
|
|
|
|
|
|
Description
|
|
|
|
-----------
|
|
|
|
|
|
|
|
The fish_vcs_prompt function can be used to display information about the current vcs repository, if any.
|
|
|
|
|
|
|
|
It calls out to vcs-specific functions. The currently supported ones are:
|
|
|
|
|
|
|
|
- fish_git_prompt
|
|
|
|
- fish_hg_prompt
|
|
|
|
- fish_svn_prompt
|
|
|
|
|
|
|
|
If a vcs isn't installed, the respective function does nothing.
|
|
|
|
|
|
|
|
For more information, see their documentation.
|
|
|
|
|
2019-03-25 02:44:45 +08:00
|
|
|
Example
|
|
|
|
-------
|
2019-02-25 08:20:25 +08:00
|
|
|
|
|
|
|
A simple prompt that displays vcs info::
|
|
|
|
|
|
|
|
function fish_prompt
|
|
|
|
...
|
|
|
|
set -g __fish_git_prompt_showupstream auto
|
|
|
|
printf '%s %s$' $PWD (fish_vcs_prompt)
|
|
|
|
end
|