mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-14 14:23:51 -05:00
Add fugitive#head() and fugitive#repo().head()
fugitive#head() returns the name of the current branch. If the current HEAD is detached, fugitive#head() will return the empty string, unless the optional 'len' argument is given, in which case the hash of the current HEAD will be truncated to 'len' characters. This makes should make life easier for people who don't want to use the default provided by fugitive#statusline()
This commit is contained in:
@@ -293,6 +293,12 @@ a statusline, this one matches the default when 'ruler' is set:
|
||||
>
|
||||
set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
|
||||
<
|
||||
*fugitive#head(...)*
|
||||
Use fugitive#head() to return the name of the current branch. If the current
|
||||
HEAD is detached, fugitive#head() will return the empty string, unless the
|
||||
optional argument is given, in which case the hash of the current commit will
|
||||
be truncated to the given number of characters.
|
||||
|
||||
ABOUT *fugitive-about*
|
||||
|
||||
Grab the latest version or report a bug on GitHub:
|
||||
|
||||
Reference in New Issue
Block a user