From 447a65b013bcf93062e70db6db791c78d1b4ca10 Mon Sep 17 00:00:00 2001 From: Cimbali Date: Tue, 29 May 2018 15:42:32 +0200 Subject: [PATCH] Crude syntax-based prettification of CtrlPTag CtrlPTagDir is not really used right now but could be concealed to show only the basename of files. See also http://ctags.sourceforge.net/FORMAT --- autoload/ctrlp/tag.vim | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/autoload/ctrlp/tag.vim b/autoload/ctrlp/tag.vim index c2294805..da138c59 100644 --- a/autoload/ctrlp/tag.vim +++ b/autoload/ctrlp/tag.vim @@ -79,8 +79,29 @@ endf fu! s:syntax() if !ctrlp#nosy() - cal ctrlp#hicheck('CtrlPTabExtra', 'Comment') - sy match CtrlPTabExtra '\zs\t.*\ze$' + cal ctrlp#hicheck('CtrlPTagComment', 'Comment') + cal ctrlp#hicheck('CtrlPTagName', 'Identifier') + cal ctrlp#hicheck('CtrlPTagPath', 'PreProc') + cal ctrlp#hicheck('CtrlPTagDir', 'PreProc') + cal ctrlp#hicheck('CtrlPTagLine', 'Identifier') + cal ctrlp#hicheck('CtrlPTagSlash', 'Conceal') + cal ctrlp#hicheck('CtrlPTagKind', 'Special') + cal ctrlp#hicheck('CtrlPTagField', 'Constant') + cal ctrlp#hicheck('CtrlPTagContent', 'Statement') + + sy match CtrlPTagPrompt '^>' nextgroup=CtrlPTagName + sy match CtrlPTagName '\s[^\t]\+'ms=s+1 nextgroup=CtrlPTagPath + sy match CtrlPTagPath skipwhite '\t[^\t]\+'ms=s+1 nextgroup=CtrlPTagLine,CtrlPTagFind contains=CtrlPTagDir + sy match CtrlPTagDir contained '/\?\([^/\\\t]\+[/\\]\)*' + sy match CtrlPTagLine contained '\t\d\+'ms=s+1 nextgroup=CtrlPTagComment + sy region CtrlPTagFind concealends matchgroup=Ignore start='\t/^\?'ms=s+1 skip='\(\\\\\)*\\/' end='\$\?/' + \ nextgroup=CtrlPTagComment contains=CtrlPTagSlash + sy match CtrlPTagSlash contained '\\[/\\^$]'he=s+1 conceal + sy region CtrlPTagComment concealends matchgroup=Ignore oneline start=';"' excludenl end='$' + \ contains=CtrlPTagKind,CtrlPTagField + sy match CtrlPTagKind contained '\t[a-zA-Z]\>'ms=s+1 + sy match CtrlPTagField contained '\t[a-z]*:[^\t]*'ms=s+1 contains=CtrlPTagContent + sy match CtrlPTagContent contained ':[^\t]*'ms=s+1 en endf " Public {{{1