From 0646a53c6bd0cba0e27d0251915b38f52fbb7d8a Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 7 May 2020 07:14:18 -0400 Subject: [PATCH] Add Help: header Closes https://github.com/tpope/vim-fugitive/issues/1513 --- autoload/fugitive.vim | 4 ++++ syntax/fugitive.vim | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 50e71d4..7115d47 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -3627,6 +3627,10 @@ function! s:DoToggleHeadHeader(value) abort call search('\C^index$', 'wc') endfunction +function! s:DoToggleHelpHeader(value) abort + exe 'help fugitive-map' +endfunction + function! s:DoStagePushHeader(value) abort let remote = matchstr(a:value, '\zs[^/]\+\ze/') if empty(remote) diff --git a/syntax/fugitive.vim b/syntax/fugitive.vim index afc0c0b..3402df8 100644 --- a/syntax/fugitive.vim +++ b/syntax/fugitive.vim @@ -8,6 +8,9 @@ syn spell notoplevel syn include @fugitiveDiff syntax/diff.vim 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 cluster fugitiveSection contains=fugitiveSection @@ -33,7 +36,10 @@ for s:section in ['Untracked', 'Unstaged', 'Staged'] endfor unlet s:section +hi def link fugitiveBareHeader fugitiveHeader +hi def link fugitiveHelpHeader fugitiveHeader hi def link fugitiveHeader Label +hi def link fugitiveHelpTag Tag hi def link fugitiveHeading PreProc hi def link fugitiveUntrackedHeading PreCondit hi def link fugitiveUnstagedHeading Macro