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