2011-02-26 14:59:28 +08:00
|
|
|
" File: tagbar.vim
|
|
|
|
" Description: Tagbar syntax settings
|
|
|
|
" Author: Jan Larres <jan@majutsushi.net>
|
|
|
|
" Licence: Vim licence
|
2020-09-13 15:07:22 +08:00
|
|
|
" Website: https://preservim.github.io/tagbar
|
2017-01-09 12:26:17 +08:00
|
|
|
" Version: 2.7
|
2011-02-26 14:59:28 +08:00
|
|
|
|
2011-07-15 13:34:47 +08:00
|
|
|
scriptencoding utf-8
|
2011-06-18 14:54:53 +08:00
|
|
|
|
2019-10-22 22:08:25 +08:00
|
|
|
if exists('b:current_syntax')
|
2013-04-24 07:33:30 +08:00
|
|
|
finish
|
2011-02-26 14:59:28 +08:00
|
|
|
endif
|
|
|
|
|
2013-04-24 07:33:30 +08:00
|
|
|
let s:ics = escape(join(g:tagbar_iconchars, ''), ']^\-')
|
2017-09-12 09:30:22 +08:00
|
|
|
|
|
|
|
let s:pattern = '\(^[' . s:ics . '] \?\)\@3<=[^-+: ]\+[^:]\+$'
|
2011-12-22 13:06:48 +08:00
|
|
|
execute "syntax match TagbarKind '" . s:pattern . "'"
|
2011-03-28 18:02:29 +08:00
|
|
|
|
2013-04-24 07:33:30 +08:00
|
|
|
let s:pattern = '\(\S\@<![' . s:ics . '][-+# ]\?\)\@<=[^*(]\+\(\*\?\(([^)]\+)\)\? :\)\@='
|
2011-12-22 13:06:48 +08:00
|
|
|
execute "syntax match TagbarScope '" . s:pattern . "'"
|
2011-03-28 18:02:29 +08:00
|
|
|
|
2013-04-13 03:14:23 +08:00
|
|
|
let s:pattern = '\S\@<![' . s:ics . ']\([-+# ]\?\)\@='
|
2011-12-22 13:06:48 +08:00
|
|
|
execute "syntax match TagbarFoldIcon '" . s:pattern . "'"
|
2011-03-26 22:32:31 +08:00
|
|
|
|
2013-04-13 03:14:23 +08:00
|
|
|
let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=+\([^-+# ]\)\@='
|
2012-11-22 13:05:59 +08:00
|
|
|
execute "syntax match TagbarVisibilityPublic '" . s:pattern . "'"
|
2013-04-13 03:14:23 +08:00
|
|
|
let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=#\([^-+# ]\)\@='
|
2012-11-22 13:05:59 +08:00
|
|
|
execute "syntax match TagbarVisibilityProtected '" . s:pattern . "'"
|
2013-04-13 03:14:23 +08:00
|
|
|
let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=-\([^-+# ]\)\@='
|
2012-11-22 13:05:59 +08:00
|
|
|
execute "syntax match TagbarVisibilityPrivate '" . s:pattern . "'"
|
2011-03-27 20:29:25 +08:00
|
|
|
|
2011-12-22 13:06:48 +08:00
|
|
|
unlet s:pattern
|
2011-03-27 20:29:25 +08:00
|
|
|
|
2013-08-22 13:01:19 +08:00
|
|
|
syntax match TagbarHelp '^".*' contains=TagbarHelpKey,TagbarHelpTitle
|
|
|
|
syntax match TagbarHelpKey '" \zs.*\ze:' contained
|
|
|
|
syntax match TagbarHelpTitle '" \zs-\+ \w\+ -\+' contained
|
|
|
|
|
2011-11-24 14:22:31 +08:00
|
|
|
syntax match TagbarNestedKind '^\s\+\[[^]]\+\]$'
|
2020-11-03 01:17:56 +08:00
|
|
|
syntax match TagbarType ' : \zs.*' contains=TagbarTagLineN
|
|
|
|
syntax match TagbarTagLineN '\s\+\[[0-9]\+\]\(\s\+\|$\)'
|
2021-01-11 21:23:42 +08:00
|
|
|
syntax match TagbarSignature '\(\<operator *( *) *\)\?\zs(.*)\ze'
|
2011-11-24 14:22:31 +08:00
|
|
|
syntax match TagbarPseudoID '\*\ze :'
|
2011-03-26 22:32:31 +08:00
|
|
|
|
2013-08-22 13:01:19 +08:00
|
|
|
highlight default link TagbarHelp Comment
|
|
|
|
highlight default link TagbarHelpKey Identifier
|
|
|
|
highlight default link TagbarHelpTitle PreProc
|
2011-11-24 14:22:31 +08:00
|
|
|
highlight default link TagbarKind Identifier
|
|
|
|
highlight default link TagbarNestedKind TagbarKind
|
|
|
|
highlight default link TagbarScope Title
|
|
|
|
highlight default link TagbarType Type
|
2020-11-03 01:17:56 +08:00
|
|
|
highlight default link TagbarTagLineN Comment
|
2011-11-24 14:22:31 +08:00
|
|
|
highlight default link TagbarSignature SpecialKey
|
|
|
|
highlight default link TagbarPseudoID NonText
|
|
|
|
highlight default link TagbarFoldIcon Statement
|
|
|
|
highlight default link TagbarHighlight Search
|
2011-02-26 14:59:28 +08:00
|
|
|
|
|
|
|
highlight default TagbarAccessPublic guifg=Green ctermfg=Green
|
|
|
|
highlight default TagbarAccessProtected guifg=Blue ctermfg=Blue
|
|
|
|
highlight default TagbarAccessPrivate guifg=Red ctermfg=Red
|
2012-11-22 13:05:59 +08:00
|
|
|
highlight default link TagbarVisibilityPublic TagbarAccessPublic
|
|
|
|
highlight default link TagbarVisibilityProtected TagbarAccessProtected
|
|
|
|
highlight default link TagbarVisibilityPrivate TagbarAccessPrivate
|
2011-02-26 14:59:28 +08:00
|
|
|
|
2019-10-22 22:08:25 +08:00
|
|
|
let b:current_syntax = 'tagbar'
|
2011-07-15 13:34:47 +08:00
|
|
|
|
|
|
|
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
|