]>
Commit | Line | Data |
---|---|---|
1 | " File: tagbar.vim | |
2 | " Description: Tagbar syntax settings | |
3 | " Author: Jan Larres <jan@majutsushi.net> | |
4 | " Licence: Vim licence | |
5 | " Website: http://majutsushi.github.com/tagbar/ | |
6 | " Version: 2.3 | |
7 | ||
8 | scriptencoding utf-8 | |
9 | ||
10 | if exists("b:current_syntax") | |
11 | finish | |
12 | endif | |
13 | ||
14 | let s:ic = g:tagbar_iconchars[0] | |
15 | if s:ic =~ '[]^\\-]' | |
16 | let s:ic = '\' . s:ic | |
17 | endif | |
18 | let s:io = g:tagbar_iconchars[1] | |
19 | if s:io =~ '[]^\\-]' | |
20 | let s:io = '\' . s:io | |
21 | endif | |
22 | ||
23 | let s:pattern = '\([' . s:ic . s:io . '] \)\@<=[^-+: ]\+[^:]\+$' | |
24 | execute "syntax match TagbarKind '" . s:pattern . "'" | |
25 | ||
26 | let s:pattern = '\([' . s:ic . s:io . '][-+# ]\)\@<=[^*]\+\(\*\?\(([^)]\+)\)\? :\)\@=' | |
27 | execute "syntax match TagbarScope '" . s:pattern . "'" | |
28 | ||
29 | let s:pattern = '[' . s:ic . s:io . ']\([-+# ]\)\@=' | |
30 | execute "syntax match TagbarFoldIcon '" . s:pattern . "'" | |
31 | ||
32 | let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=+\([^-+# ]\)\@=' | |
33 | execute "syntax match TagbarAccessPublic '" . s:pattern . "'" | |
34 | let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=#\([^-+# ]\)\@=' | |
35 | execute "syntax match TagbarAccessProtected '" . s:pattern . "'" | |
36 | let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=-\([^-+# ]\)\@=' | |
37 | execute "syntax match TagbarAccessPrivate '" . s:pattern . "'" | |
38 | ||
39 | unlet s:pattern | |
40 | ||
41 | syntax match TagbarNestedKind '^\s\+\[[^]]\+\]$' | |
42 | syntax match TagbarComment '^".*' | |
43 | syntax match TagbarType ' : \zs.*' | |
44 | syntax match TagbarSignature '(.*)' | |
45 | syntax match TagbarPseudoID '\*\ze :' | |
46 | ||
47 | highlight default link TagbarComment Comment | |
48 | highlight default link TagbarKind Identifier | |
49 | highlight default link TagbarNestedKind TagbarKind | |
50 | highlight default link TagbarScope Title | |
51 | highlight default link TagbarType Type | |
52 | highlight default link TagbarSignature SpecialKey | |
53 | highlight default link TagbarPseudoID NonText | |
54 | highlight default link TagbarFoldIcon Statement | |
55 | highlight default link TagbarHighlight Search | |
56 | ||
57 | highlight default TagbarAccessPublic guifg=Green ctermfg=Green | |
58 | highlight default TagbarAccessProtected guifg=Blue ctermfg=Blue | |
59 | highlight default TagbarAccessPrivate guifg=Red ctermfg=Red | |
60 | ||
61 | let b:current_syntax = "tagbar" | |
62 | ||
63 | " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 |