Add the vcs prompts to sphinx docs

This commit is contained in:
ridiculousfish 2019-02-24 16:20:25 -08:00
parent 9a35df059a
commit 6cd8856484
4 changed files with 254 additions and 0 deletions

View file

@ -0,0 +1,95 @@
fish_git_prompt - output git information for use in a prompt
============================================================
Description
-----------
The fish_git_prompt function can be used to display information about the current git repository, if any.
For obvious reasons, it requires having git installed.
There are numerous configuration options, either as fish variables or git config variables. If a git config variable is supported, it will be used if set, and the fish variable will only be used if it isn't.
- $__fish_git_prompt_showdirtystate or the git config option "bash.showDirtyState" can be set to show if the repository is "dirty", i.e. has uncommitted changes.
- $__fish_git_prompt_showuntrackedfiles or the git config option "bash.showUntrackedFiles" can be set to show if the repository has untracked files (that aren't ignored).
- $__fish_git_prompt_show_informative_status or the git config option "bash.showInformativeStatus" can be set to enable the "informative" display, which will show a large amount of information - the number of untracked files, dirty files, unpushed/unpulled commits, etc... In large repositories, this can take a lot of time, so it is recommended to disable it there.
- $__fish_git_prompt_showupstream can be set to a number of values to determine how changes between HEAD and upstream are shown:
verbose show number of commits ahead/behind (+/-) upstream
name if verbose, then also show the upstream abbrev name
informative similar to verbose, but shows nothing when equal (fish only)
git always compare HEAD to @{upstream}
svn always compare HEAD to your SVN upstream
none disables (fish only, useful with show_informative_status)
- $__fish_git_prompt_showstashstate can be set to display the state of the stash.
- $__fish_git_prompt_shorten_branch_len can be set to the number of characters that the branch name will be shortened to.
- $__fish_git_prompt_describe_style can be set to a number of styles that describe the current HEAD:
contains
branch
describe
default
- $__fish_git_prompt_showcolorhints can be set to enable coloring for certain things.
A number of variables to set characters and color used to indicate things.
- $__fish_git_prompt_char_cleanstate
- $__fish_git_prompt_char_dirtystate
- $__fish_git_prompt_char_invalidstate
- $__fish_git_prompt_char_stagedstate
- $__fish_git_prompt_char_stashstate
- $__fish_git_prompt_char_stateseparator
- $__fish_git_prompt_char_untrackedfiles
- $__fish_git_prompt_char_upstream_ahead
- $__fish_git_prompt_char_upstream_behind
- $__fish_git_prompt_char_upstream_diverged
- $__fish_git_prompt_char_upstream_equal
- $__fish_git_prompt_char_upstream_prefix
- $__fish_git_prompt_color
- $__fish_git_prompt_color_prefix
- $__fish_git_prompt_color_suffix
- $__fish_git_prompt_color_bare
- $__fish_git_prompt_color_merging
- $__fish_git_prompt_color_cleanstate
- $__fish_git_prompt_color_invalidstate
- $__fish_git_prompt_color_upstream
Colors used with showcolorhints:
- $__fish_git_prompt_color_flags
- $__fish_git_prompt_color_branch
- $__fish_git_prompt_color_dirtystate
- $__fish_git_prompt_color_stagedstate
- $__fish_git_prompt_color_flags
- $__fish_git_prompt_color_branch
- $__fish_git_prompt_color_dirtystate
- $__fish_git_prompt_color_stagedstate
- $__fish_git_prompt_color_branch_detached
Colors used with their respective flags enabled:
- $__fish_git_prompt_color_stashstate
- $__fish_git_prompt_color_untrackedfiles
Note that all colors can also have a corresponding "_done" color. E.g. $__fish_git_prompt_color_upstream_done, used right _after_ the upstream.
See also fish_vcs_prompt, which will call all supported vcs-prompt functions, including git, hg and svn.
Example
--------
A simple prompt that displays git info::
function fish_prompt
...
set -g __fish_git_prompt_showupstream auto
printf '%s %s$' $PWD (fish_git_prompt)
end

View file

@ -0,0 +1,47 @@
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.
For obvious reasons, it requires having hg installed.
There are numerous configuration options:
- $fish_color_hg_clean, $fish_color_hg_modified and $fish_color_hg_dirty: The color to use when the repo 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
And 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 '!'
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``.
See also fish_vcs_prompt, which will call all supported vcs-prompt functions, including git, hg and svn.
Example
-------
A simple prompt that displays hg info::
function fish_prompt
...
printf '%s %s$' $PWD (fish_hg_prompt)
end

View file

@ -0,0 +1,85 @@
fish_svn_prompt - output svn information for use in a prompt
============================================================
Description
-----------
The fish_svn_prompt function can be used to display information about the current svn repository, if any.
For obvious reasons, it requires having svn installed.
There are numerous configuration options:
- $__fish_svn_prompt_color_revision, the colour of the revision number to display in the prompt
# setting the prompt status separator character
- $__fish_svn_prompt_char_separator, the separator between status characters
And
- $__fish_svn_prompt_char_added_display
- $__fish_svn_prompt_char_added_color
- $__fish_svn_prompt_char_conflicted_display
- $__fish_svn_prompt_char_conflicted_color
- $__fish_svn_prompt_char_deleted_display
- $__fish_svn_prompt_char_deleted_color
- $__fish_svn_prompt_char_ignored_display
- $__fish_svn_prompt_char_ignored_color
- $__fish_svn_prompt_char_modified_display
- $__fish_svn_prompt_char_modified_color
- $__fish_svn_prompt_char_replaced_display
- $__fish_svn_prompt_char_replaced_color
- $__fish_svn_prompt_char_unversioned_external_display
- $__fish_svn_prompt_char_unversioned_external_color
- $__fish_svn_prompt_char_unversioned_display
- $__fish_svn_prompt_char_unversioned_color
- $__fish_svn_prompt_char_missing_display
- $__fish_svn_prompt_char_missing_color
- $__fish_svn_prompt_char_versioned_obstructed_display
- $__fish_svn_prompt_char_versioned_obstructed_color
- $__fish_svn_prompt_char_locked_display
- $__fish_svn_prompt_char_locked_color
- $__fish_svn_prompt_char_scheduled_display
- $__fish_svn_prompt_char_scheduled_color
- $__fish_svn_prompt_char_switched_display
- $__fish_svn_prompt_char_switched_color
- $__fish_svn_prompt_char_token_present_display
- $__fish_svn_prompt_char_token_present_color
- $__fish_svn_prompt_char_token_other_display
- $__fish_svn_prompt_char_token_other_color
- $__fish_svn_prompt_char_token_stolen_display
- $__fish_svn_prompt_char_token_stolen_color
- $__fish_svn_prompt_char_token_broken_display
- $__fish_svn_prompt_char_token_broken_color
to choose the color and symbol for different parts of the prompt.
See also fish_vcs_prompt, which will call all supported vcs-prompt functions, including git, hg and svn.
Example
-------
A simple prompt that displays svn info::
function fish_prompt
...
printf '%s %s$' $PWD (fish_svn_prompt)
end

View file

@ -0,0 +1,27 @@
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.
\subsection fish_vcs_prompt-example Example
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