Skip to content

Commit 6fdffdc

Browse files
committed
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
1 parent 4b9e7ca commit 6fdffdc

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

autoload/ctrlp/tag.vim

+23-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,29 @@ endf
7979

8080
fu! s:syntax()
8181
if !ctrlp#nosy()
82-
cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
83-
sy match CtrlPTabExtra '\zs\t.*\ze$'
82+
cal ctrlp#hicheck('CtrlPTagComment', 'Comment')
83+
cal ctrlp#hicheck('CtrlPTagName', 'Identifier')
84+
cal ctrlp#hicheck('CtrlPTagPath', 'PreProc')
85+
cal ctrlp#hicheck('CtrlPTagDir', 'PreProc')
86+
cal ctrlp#hicheck('CtrlPTagLine', 'Identifier')
87+
cal ctrlp#hicheck('CtrlPTagSlash', 'Conceal')
88+
cal ctrlp#hicheck('CtrlPTagKind', 'Special')
89+
cal ctrlp#hicheck('CtrlPTagField', 'Constant')
90+
cal ctrlp#hicheck('CtrlPTagContent', 'Statement')
91+
92+
sy match CtrlPTagPrompt '^>' nextgroup=CtrlPTagName
93+
sy match CtrlPTagName '\s[^\t]\+'ms=s+1 nextgroup=CtrlPTagPath
94+
sy match CtrlPTagPath skipwhite '\t[^\t]\+'ms=s+1 nextgroup=CtrlPTagLine,CtrlPTagFind contains=CtrlPTagDir
95+
sy match CtrlPTagDir contained '/\?\([^/\\\t]\+[/\\]\)*'
96+
sy match CtrlPTagLine contained '\t\d\+'ms=s+1 nextgroup=CtrlPTagComment
97+
sy region CtrlPTagFind concealends matchgroup=Ignore start='\t/^\?'ms=s+1 skip='\(\\\\\)*\\/' end='\$\?/'
98+
\ nextgroup=CtrlPTagComment contains=CtrlPTagSlash
99+
sy match CtrlPTagSlash contained '\\[/\\^$]'he=s+1 conceal
100+
sy region CtrlPTagComment concealends matchgroup=Ignore oneline start=';"' excludenl end='$'
101+
\ contains=CtrlPTagKind,CtrlPTagField
102+
sy match CtrlPTagKind contained '\t[a-zA-Z]\>'ms=s+1
103+
sy match CtrlPTagField contained '\t[a-z]*:[^\t]*'ms=s+1 contains=CtrlPTagContent
104+
sy match CtrlPTagContent contained ':[^\t]*'ms=s+1
84105
en
85106
endf
86107
" Public {{{1

0 commit comments

Comments
 (0)