tagbar/syntax/tagbar.vim

64 lines
2.1 KiB
VimL
Raw Normal View History

" File: tagbar.vim
" Description: Tagbar syntax settings
" Author: Jan Larres <jan@majutsushi.net>
" Licence: Vim licence
" Website: http://majutsushi.github.com/tagbar/
2012-07-16 17:38:20 +08:00
" Version: 2.4.1
2011-07-15 13:34:47 +08:00
scriptencoding utf-8
2011-06-18 14:54:53 +08:00
if exists("b:current_syntax")
finish
endif
2011-12-22 13:06:48 +08:00
let s:ic = g:tagbar_iconchars[0]
if s:ic =~ '[]^\\-]'
let s:ic = '\' . s:ic
endif
let s:io = g:tagbar_iconchars[1]
if s:io =~ '[]^\\-]'
let s:io = '\' . s:io
endif
2011-12-22 13:06:48 +08:00
let s:pattern = '\([' . s:ic . s:io . '] \)\@<=[^-+: ]\+[^:]\+$'
execute "syntax match TagbarKind '" . s:pattern . "'"
2011-03-28 18:02:29 +08:00
2011-12-22 13:06:48 +08:00
let s:pattern = '\([' . s:ic . s:io . '][-+# ]\)\@<=[^*]\+\(\*\?\(([^)]\+)\)\? :\)\@='
execute "syntax match TagbarScope '" . s:pattern . "'"
2011-03-28 18:02:29 +08:00
2011-12-22 13:06:48 +08:00
let s:pattern = '[' . s:ic . s:io . ']\([-+# ]\)\@='
execute "syntax match TagbarFoldIcon '" . s:pattern . "'"
2011-03-26 22:32:31 +08:00
2011-12-22 13:06:48 +08:00
let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=+\([^-+# ]\)\@='
execute "syntax match TagbarAccessPublic '" . s:pattern . "'"
let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=#\([^-+# ]\)\@='
execute "syntax match TagbarAccessProtected '" . s:pattern . "'"
let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=-\([^-+# ]\)\@='
execute "syntax match TagbarAccessPrivate '" . s:pattern . "'"
2011-12-22 13:06:48 +08:00
unlet s:pattern
syntax match TagbarNestedKind '^\s\+\[[^]]\+\]$'
syntax match TagbarComment '^".*'
syntax match TagbarType ' : \zs.*'
syntax match TagbarSignature '(.*)'
syntax match TagbarPseudoID '\*\ze :'
2011-03-26 22:32:31 +08:00
highlight default link TagbarComment Comment
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
highlight default TagbarAccessPublic guifg=Green ctermfg=Green
highlight default TagbarAccessProtected guifg=Blue ctermfg=Blue
highlight default TagbarAccessPrivate guifg=Red ctermfg=Red
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