2010-05-12 02:00:00 +02:00
|
|
|
" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79
|
2010-01-20 01:00:00 +01:00
|
|
|
" Vimwiki syntax file
|
|
|
|
" Author: Maxim Kim <habamax@gmail.com>
|
|
|
|
" Home: http://code.google.com/p/vimwiki/
|
|
|
|
|
|
|
|
" Quit if syntax file is already loaded
|
|
|
|
if version < 600
|
|
|
|
syntax clear
|
|
|
|
elseif exists("b:current_syntax")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
" Links highlighting is controlled by vimwiki#highlight_links() function.
|
|
|
|
" It is called from setup_buffer_enter() function in the BufEnter autocommand.
|
|
|
|
|
|
|
|
" Load concrete Wiki syntax
|
|
|
|
execute 'runtime! syntax/vimwiki_'.VimwikiGet('syntax').'.vim'
|
|
|
|
|
|
|
|
" Concealed chars
|
|
|
|
if exists("+conceallevel")
|
|
|
|
syntax conceal on
|
|
|
|
endif
|
|
|
|
syn match VimwikiLinkChar contained /\[\[/
|
|
|
|
syn match VimwikiLinkChar contained /\]\]/
|
|
|
|
syn match VimwikiLinkChar contained /\[\[[^\[\]\|]\{-}|\ze.\{-}]]/
|
|
|
|
syn match VimwikiLinkChar contained /\[\[[^\[\]\|]\{-}]\[\ze.\{-}]]/
|
|
|
|
|
|
|
|
syn match VimwikiNoLinkChar contained /\[\[/
|
|
|
|
syn match VimwikiNoLinkChar contained /\]\]/
|
|
|
|
syn match VimwikiNoLinkChar contained /\[\[[^\[\]\|]\{-}|\ze.*]]/
|
|
|
|
syn match VimwikiNoLinkChar contained /\[\[[^\[\]\|]\{-}]\[\ze.*]]/
|
|
|
|
|
|
|
|
execute 'syn match VimwikiBoldChar contained /'.g:vimwiki_char_bold.'/'
|
|
|
|
execute 'syn match VimwikiItalicChar contained /'.g:vimwiki_char_italic.'/'
|
|
|
|
execute 'syn match VimwikiBoldItalicChar contained /'.g:vimwiki_char_bolditalic.'/'
|
|
|
|
execute 'syn match VimwikiItalicBoldChar contained /'.g:vimwiki_char_italicbold.'/'
|
|
|
|
execute 'syn match VimwikiCodeChar contained /'.g:vimwiki_char_code.'/'
|
|
|
|
execute 'syn match VimwikiDelTextChar contained /'.g:vimwiki_char_deltext.'/'
|
|
|
|
execute 'syn match VimwikiSuperScript contained /'.g:vimwiki_char_superscript.'/'
|
|
|
|
execute 'syn match VimwikiSubScript contained /'.g:vimwiki_char_subscript.'/'
|
|
|
|
if exists("+conceallevel")
|
|
|
|
syntax conceal off
|
2010-01-20 01:00:00 +01:00
|
|
|
endif
|
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
" Non concealed chars
|
|
|
|
syn match VimwikiHeaderChar contained /\%(^\s*=\+\)\|\%(=\+\s*$\)/
|
|
|
|
execute 'syn match VimwikiBoldCharT contained /'.g:vimwiki_char_bold.'/'
|
|
|
|
execute 'syn match VimwikiItalicCharT contained /'.g:vimwiki_char_italic.'/'
|
|
|
|
execute 'syn match VimwikiBoldItalicCharT contained /'.g:vimwiki_char_bolditalic.'/'
|
|
|
|
execute 'syn match VimwikiItalicBoldCharT contained /'.g:vimwiki_char_italicbold.'/'
|
|
|
|
execute 'syn match VimwikiCodeCharT contained /'.g:vimwiki_char_code.'/'
|
|
|
|
execute 'syn match VimwikiDelTextCharT contained /'.g:vimwiki_char_deltext.'/'
|
|
|
|
execute 'syn match VimwikiSuperScriptT contained /'.g:vimwiki_char_superscript.'/'
|
|
|
|
execute 'syn match VimwikiSubScriptT contained /'.g:vimwiki_char_subscript.'/'
|
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
|
|
|
|
" Emoticons
|
|
|
|
syntax match VimwikiEmoticons /\%((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)/
|
|
|
|
|
2010-02-23 01:00:00 +01:00
|
|
|
let g:vimwiki_rxTodo = '\C\%(TODO:\|DONE:\|STARTED:\|FIXME:\|FIXED:\|XXX:\)'
|
2010-01-20 01:00:00 +01:00
|
|
|
execute 'syntax match VimwikiTodo /'. g:vimwiki_rxTodo .'/'
|
|
|
|
|
|
|
|
|
|
|
|
" Tables
|
2010-02-23 01:00:00 +01:00
|
|
|
" execute 'syntax match VimwikiTable /'.g:vimwiki_rxTable.'/'
|
2010-08-24 02:00:00 +02:00
|
|
|
syntax match VimwikiTableRow /^\s*|.\+|\s*$/
|
|
|
|
\ transparent contains=VimwikiCellSeparator,VimwikiLinkT,
|
|
|
|
\ VimwikiNoExistsLinkT,VimwikiEmoticons,VimwikiTodo,
|
|
|
|
\ VimwikiBoldT,VimwikiItalicT,VimwikiBoldItalicT,VimwikiItalicBoldT,
|
|
|
|
\ VimwikiDelTextT,VimwikiSuperScriptT,VimwikiSubScriptT,VimwikiCodeT
|
2010-02-23 01:00:00 +01:00
|
|
|
syntax match VimwikiCellSeparator
|
|
|
|
\ /\%(|\)\|\%(-\@<=+\-\@=\)\|\%([|+]\@<=-\+\)/ contained
|
2010-01-20 01:00:00 +01:00
|
|
|
|
|
|
|
" List items
|
|
|
|
execute 'syntax match VimwikiList /'.g:vimwiki_rxListBullet.'/'
|
|
|
|
execute 'syntax match VimwikiList /'.g:vimwiki_rxListNumber.'/'
|
|
|
|
execute 'syntax match VimwikiList /'.g:vimwiki_rxListDefine.'/'
|
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
execute 'syntax match VimwikiBold /'.g:vimwiki_rxBold.'/ contains=VimwikiBoldChar'
|
|
|
|
execute 'syntax match VimwikiBoldT /'.g:vimwiki_rxBold.'/ contained contains=VimwikiBoldCharT'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
execute 'syntax match VimwikiItalic /'.g:vimwiki_rxItalic.'/ contains=VimwikiItalicChar'
|
|
|
|
execute 'syntax match VimwikiItalicT /'.g:vimwiki_rxItalic.'/ contained contains=VimwikiItalicCharT'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
execute 'syntax match VimwikiBoldItalic /'.g:vimwiki_rxBoldItalic.'/ contains=VimwikiBoldItalicChar,VimwikiItalicBoldChar'
|
|
|
|
execute 'syntax match VimwikiBoldItalicT /'.g:vimwiki_rxBoldItalic.'/ contained contains=VimwikiBoldItalicChatT,VimwikiItalicBoldCharT'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
execute 'syntax match VimwikiItalicBold /'.g:vimwiki_rxItalicBold.'/ contains=VimwikiBoldItalicChar,VimwikiItalicBoldChar'
|
|
|
|
execute 'syntax match VimwikiItalicBoldT /'.g:vimwiki_rxItalicBold.'/ contained contains=VimwikiBoldItalicCharT,VimsikiItalicBoldCharT'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
execute 'syntax match VimwikiDelText /'.g:vimwiki_rxDelText.'/ contains=VimwikiDelTextChar'
|
|
|
|
execute 'syntax match VimwikiDelTextT /'.g:vimwiki_rxDelText.'/ contained contains=VimwikiDelTextChar'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
execute 'syntax match VimwikiSuperScript /'.g:vimwiki_rxSuperScript.'/ contains=VimwikiSuperScriptChar'
|
|
|
|
execute 'syntax match VimwikiSuperScriptT /'.g:vimwiki_rxSuperScript.'/ contained contains=VimwikiSuperScriptCharT'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
execute 'syntax match VimwikiSubScript /'.g:vimwiki_rxSubScript.'/ contains=VimwikiSubScriptChar'
|
|
|
|
execute 'syntax match VimwikiSubScriptT /'.g:vimwiki_rxSubScript.'/ contained contains=VimwikiSubScriptCharT'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
execute 'syntax match VimwikiCode /'.g:vimwiki_rxCode.'/ contains=VimwikiCodeChar'
|
|
|
|
execute 'syntax match VimwikiCodeT /'.g:vimwiki_rxCode.'/ contained contains=VimwikiCodeCharT'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
|
|
|
" <hr> horizontal rule
|
|
|
|
execute 'syntax match VimwikiHR /'.g:vimwiki_rxHR.'/'
|
|
|
|
|
|
|
|
execute 'syntax region VimwikiPre start=/'.g:vimwiki_rxPreStart.
|
|
|
|
\ '/ end=/'.g:vimwiki_rxPreEnd.'/ contains=VimwikiComment'
|
|
|
|
|
|
|
|
" List item checkbox
|
|
|
|
syntax match VimwikiCheckBox /\[.\?\]/
|
|
|
|
if g:vimwiki_hl_cb_checked
|
|
|
|
execute 'syntax match VimwikiCheckBoxDone /'.
|
2010-05-12 02:00:00 +02:00
|
|
|
\ g:vimwiki_rxListBullet.'\s*\['.g:vimwiki_listsyms[4].'\].*$/'.
|
|
|
|
\ ' contains=VimwikiNoExistsLink,VimwikiLink'
|
2010-01-20 01:00:00 +01:00
|
|
|
execute 'syntax match VimwikiCheckBoxDone /'.
|
2010-05-12 02:00:00 +02:00
|
|
|
\ g:vimwiki_rxListNumber.'\s*\['.g:vimwiki_listsyms[4].'\].*$/'.
|
|
|
|
\ ' contains=VimwikiNoExistsLink,VimwikiLink'
|
2010-01-20 01:00:00 +01:00
|
|
|
endif
|
|
|
|
|
2010-05-12 02:00:00 +02:00
|
|
|
" placeholders
|
2010-08-24 02:00:00 +02:00
|
|
|
syntax match VimwikiPlaceholder /^\s*%toc\%(\s.*\)\?$/ contains=VimwikiPlaceholderParam
|
2010-05-12 02:00:00 +02:00
|
|
|
syntax match VimwikiPlaceholder /^\s*%nohtml\s*$/
|
2010-08-24 02:00:00 +02:00
|
|
|
syntax match VimwikiPlaceholder /^\s*%title\%(\s.*\)\?$/ contains=VimwikiPlaceholderParam
|
|
|
|
syntax match VimwikiPlaceholderParam /\s.*/ contained
|
2010-05-12 02:00:00 +02:00
|
|
|
|
|
|
|
" html tags
|
2010-08-24 02:00:00 +02:00
|
|
|
let html_tags = join(split(g:vimwiki_valid_html_tags, '\s*,\s*'), '\|')
|
|
|
|
exe 'syntax match VimwikiHTMLtag #\c</\?\%('.html_tags.'\)\%(\s\{-1}\S\{-}\)\{-}\s*/\?>#'
|
|
|
|
execute 'syntax match VimwikiBold #\c<b>.\{-}</b># contains=VimwikiHTMLTag'
|
|
|
|
execute 'syntax match VimwikiItalic #\c<i>.\{-}</i># contains=VimwikiHTMLTag'
|
|
|
|
execute 'syntax match VimwikiUnderline #\c<u>.\{-}</u># contains=VimwikiHTMLTag'
|
2010-05-12 02:00:00 +02:00
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
syntax region VimwikiComment start='<!--' end='-->'
|
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
if g:vimwiki_hl_headers == 0
|
|
|
|
execute 'syntax match VimwikiHeader /'.g:vimwiki_rxHeader.'/ contains=VimwikiTodo,VimwikiHeaderChar'
|
2010-01-20 01:00:00 +01:00
|
|
|
else
|
|
|
|
" Header levels, 1-6
|
2010-08-24 02:00:00 +02:00
|
|
|
execute 'syntax match VimwikiHeader1 /'.g:vimwiki_rxH1.'/ contains=VimwikiTodo,VimwikiHeaderChar'
|
|
|
|
execute 'syntax match VimwikiHeader2 /'.g:vimwiki_rxH2.'/ contains=VimwikiTodo,VimwikiHeaderChar'
|
|
|
|
execute 'syntax match VimwikiHeader3 /'.g:vimwiki_rxH3.'/ contains=VimwikiTodo,VimwikiHeaderChar'
|
|
|
|
execute 'syntax match VimwikiHeader4 /'.g:vimwiki_rxH4.'/ contains=VimwikiTodo,VimwikiHeaderChar'
|
|
|
|
execute 'syntax match VimwikiHeader5 /'.g:vimwiki_rxH5.'/ contains=VimwikiTodo,VimwikiHeaderChar'
|
|
|
|
execute 'syntax match VimwikiHeader6 /'.g:vimwiki_rxH6.'/ contains=VimwikiTodo,VimwikiHeaderChar'
|
2010-01-20 01:00:00 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
" group names "{{{
|
2010-08-24 02:00:00 +02:00
|
|
|
|
|
|
|
call vimwiki#setup_colors()
|
2010-01-20 01:00:00 +01:00
|
|
|
|
|
|
|
hi def VimwikiBold term=bold cterm=bold gui=bold
|
2010-08-24 02:00:00 +02:00
|
|
|
hi def link VimwikiBoldT VimwikiBold
|
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
hi def VimwikiItalic term=italic cterm=italic gui=italic
|
2010-08-24 02:00:00 +02:00
|
|
|
hi def link VimwikiItalicT VimwikiItalic
|
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
hi def VimwikiBoldItalic term=bold cterm=bold gui=bold,italic
|
|
|
|
hi def link VimwikiItalicBold VimwikiBoldItalic
|
2010-08-24 02:00:00 +02:00
|
|
|
hi def link VimwikiBoldItalicT VimwikiBoldItalic
|
|
|
|
hi def link VimwikiItalicBoldT VimwikiBoldItalic
|
|
|
|
|
|
|
|
hi def VimwikiUnderline gui=underline
|
2010-01-20 01:00:00 +01:00
|
|
|
|
|
|
|
hi def link VimwikiCode PreProc
|
2010-08-24 02:00:00 +02:00
|
|
|
hi def link VimwikiCodeT VimwikiCode
|
|
|
|
|
2010-05-12 02:00:00 +02:00
|
|
|
hi def link VimwikiNoExistsLink Error
|
2010-08-24 02:00:00 +02:00
|
|
|
hi def link VimwikiNoExistsLinkT VimwikiNoExistsLink
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-05-12 02:00:00 +02:00
|
|
|
hi def link VimwikiPre PreProc
|
2010-08-24 02:00:00 +02:00
|
|
|
hi def link VimwikiPreT VimwikiPre
|
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
hi def link VimwikiLink Underlined
|
2010-08-24 02:00:00 +02:00
|
|
|
hi def link VimwikiLinkT Underlined
|
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
hi def link VimwikiList Function
|
|
|
|
hi def link VimwikiCheckBox VimwikiList
|
|
|
|
hi def link VimwikiCheckBoxDone Comment
|
|
|
|
hi def link VimwikiEmoticons Character
|
2010-08-24 02:00:00 +02:00
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
hi def link VimwikiDelText Constant
|
2010-08-24 02:00:00 +02:00
|
|
|
hi def link VimwikiDelTextT VimwikiDelText
|
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
hi def link VimwikiSuperScript Number
|
2010-08-24 02:00:00 +02:00
|
|
|
hi def link VimwikiSuperScriptT VimwikiSuperScript
|
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
hi def link VimwikiSubScript Number
|
2010-08-24 02:00:00 +02:00
|
|
|
hi def link VimwikiSubScriptT VimwikiSubScript
|
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
hi def link VimwikiTodo Todo
|
|
|
|
hi def link VimwikiComment Comment
|
2010-02-23 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
hi def link VimwikiCellSeparator PreProc
|
|
|
|
|
2010-05-12 02:00:00 +02:00
|
|
|
hi def link VimwikiPlaceholder SpecialKey
|
2010-08-24 02:00:00 +02:00
|
|
|
hi def link VimwikiPlaceholderParam String
|
2010-05-12 02:00:00 +02:00
|
|
|
hi def link VimwikiHTMLtag SpecialKey
|
2010-08-24 02:00:00 +02:00
|
|
|
|
|
|
|
hi def link VimwikiBoldChar VimwikiIgnore
|
|
|
|
hi def link VimwikiItalicChar VimwikiIgnore
|
|
|
|
hi def link VimwikiBoldItalicChar VimwikiIgnore
|
|
|
|
hi def link VimwikiItalicBoldChar VimwikiIgnore
|
|
|
|
hi def link VimwikiDelTextChar VimwikiIgnore
|
|
|
|
hi def link VimwikiSuperScriptChar VimwikiIgnore
|
|
|
|
hi def link VimwikiSubScriptChar VimwikiIgnore
|
|
|
|
hi def link VimwikiCodeChar VimwikiIgnore
|
|
|
|
hi def link VimwikiHeaderChar VimwikiIgnore
|
|
|
|
hi def link VimwikiLinkChar VimwikiLink
|
|
|
|
hi def link VimwikiNoLinkChar VimwikiNoExistsLink
|
|
|
|
|
|
|
|
hi def link VimwikiBoldCharT VimwikiIgnore
|
|
|
|
hi def link VimwikiItalicCharT VimwikiIgnore
|
|
|
|
hi def link VimwikiBoldItalicCharT VimwikiIgnore
|
|
|
|
hi def link VimwikiItalicBoldCharT VimwikiIgnore
|
|
|
|
hi def link VimwikiDelTextCharT VimwikiIgnore
|
|
|
|
hi def link VimwikiSuperScriptCharT VimwikiIgnore
|
|
|
|
hi def link VimwikiSubScriptCharT VimwikiIgnore
|
|
|
|
hi def link VimwikiCodeCharT VimwikiIgnore
|
|
|
|
hi def link VimwikiHeaderCharT VimwikiIgnore
|
|
|
|
hi def link VimwikiLinkCharT VimwikiLinkT
|
|
|
|
hi def link VimwikiNoLinkCharT VimwikiNoExistsLinkT
|
2010-01-20 01:00:00 +01:00
|
|
|
"}}}
|
|
|
|
|
|
|
|
let b:current_syntax="vimwiki"
|
|
|
|
|
|
|
|
" EMBEDDED syntax setup "{{{
|
|
|
|
let nested = VimwikiGet('nested_syntaxes')
|
|
|
|
if !empty(nested)
|
|
|
|
for [hl_syntax, vim_syntax] in items(nested)
|
|
|
|
call vimwiki#nested_syntax(vim_syntax,
|
2010-08-24 02:00:00 +02:00
|
|
|
\ '^\s*{{{\%(.*[[:blank:][:punct:]]\)\?'.
|
2010-01-20 01:00:00 +01:00
|
|
|
\ hl_syntax.'\%([[:blank:][:punct:]].*\)\?',
|
2010-08-24 02:00:00 +02:00
|
|
|
\ '^\s*}}}', 'VimwikiPre')
|
2010-01-20 01:00:00 +01:00
|
|
|
endfor
|
|
|
|
endif
|
|
|
|
"}}}
|