Add Help: header

Closes https://github.com/tpope/vim-fugitive/issues/1513
This commit is contained in:
Tim Pope
2020-05-07 07:14:18 -04:00
parent d2abfca08f
commit 0646a53c6b
2 changed files with 10 additions and 0 deletions

View File

@@ -3627,6 +3627,10 @@ function! s:DoToggleHeadHeader(value) abort
call search('\C^index$', 'wc') call search('\C^index$', 'wc')
endfunction endfunction
function! s:DoToggleHelpHeader(value) abort
exe 'help fugitive-map'
endfunction
function! s:DoStagePushHeader(value) abort function! s:DoStagePushHeader(value) abort
let remote = matchstr(a:value, '\zs[^/]\+\ze/') let remote = matchstr(a:value, '\zs[^/]\+\ze/')
if empty(remote) if empty(remote)

View File

@@ -8,6 +8,9 @@ syn spell notoplevel
syn include @fugitiveDiff syntax/diff.vim syn include @fugitiveDiff syntax/diff.vim
syn match fugitiveHeader /^[A-Z][a-z][^:]*:/ nextgroup=fugitiveHash,fugitiveSymbolicRef skipwhite syn match fugitiveHeader /^[A-Z][a-z][^:]*:/ nextgroup=fugitiveHash,fugitiveSymbolicRef skipwhite
syn match fugitiveBareHeader /^Bare:/
syn match fugitiveHelpHeader /^Help:/ nextgroup=fugitiveHelpTag skipwhite
syn match fugitiveHelpTag /\S\+/ contained
syn region fugitiveSection start=/^\%(.*(\d\+)$\)\@=/ contains=fugitiveHeading end=/^$/ syn region fugitiveSection start=/^\%(.*(\d\+)$\)\@=/ contains=fugitiveHeading end=/^$/
syn cluster fugitiveSection contains=fugitiveSection syn cluster fugitiveSection contains=fugitiveSection
@@ -33,7 +36,10 @@ for s:section in ['Untracked', 'Unstaged', 'Staged']
endfor endfor
unlet s:section unlet s:section
hi def link fugitiveBareHeader fugitiveHeader
hi def link fugitiveHelpHeader fugitiveHeader
hi def link fugitiveHeader Label hi def link fugitiveHeader Label
hi def link fugitiveHelpTag Tag
hi def link fugitiveHeading PreProc hi def link fugitiveHeading PreProc
hi def link fugitiveUntrackedHeading PreCondit hi def link fugitiveUntrackedHeading PreCondit
hi def link fugitiveUnstagedHeading Macro hi def link fugitiveUnstagedHeading Macro