Version 0.9.8
* NEW: Rename g:vimwiki_fold_empty_lines to g:vimwiki_fold_trailing_empty_lines. * NEW: One can use - along with * to start unordered list item. * NEW: List items could be started from the first column. As a result some limitations appeared: * a space after *, - or # for a list item is mandatory. * g:vimwiki_fold_trailing_empty_lines if set to 0 folds one trailing empty line. * NEW: Folding is off by default. Use g:vimwiki_folding to enable it. * NEW: Speed up vimwiki's folding a bit. Should lag a bit less in a long todo lists. * NEW: Centered headers. Start header with at least one space to make it html centered. * NEW: Change in default css: header's colors. * NEW: Vimwiki is aware of GetLatestVimScripts now. * FIX: Use <del> tag instead of custom <span class="strike"> in html. * FIX: There are no text styling in htmlized quoted text. * FIX: set default value of g:vimwiki_fold_lists to 0 as written in this help. * FIX: Issue 33: Folded list items have wrong indentation when 'tabs' are used. * FIX: Issue 34: vimwiki#subdir got wrong dir when VimwikiGet('path') is a symbolic link. Thanks lilydjwg for the patch. * FIX: Issue 28: todo-list auto-indent enhancement. New item should always be unchecked. * FIX: Issue 36: Change the name of the :Search command to :VimwikiSearch as it conflicts with MultipleSearch. Alias :VWS is also available. * NEW: You can generate 'Table of contents' of your wiki page. See :h vimwiki-toc for details.
This commit is contained in:
141
syntax/vimwiki.vim
Normal file
141
syntax/vimwiki.vim
Normal file
@ -0,0 +1,141 @@
|
||||
" Vimwiki syntax file
|
||||
" Author: Maxim Kim <habamax@gmail.com>
|
||||
" Home: http://code.google.com/p/vimwiki/
|
||||
" vim:tw=79:
|
||||
|
||||
" Quit if syntax file is already loaded
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
"" use max highlighting - could be quite slow if there are too many wikifiles
|
||||
if VimwikiGet('maxhi')
|
||||
" Every WikiWord is nonexistent
|
||||
if g:vimwiki_camel_case
|
||||
execute 'syntax match VimwikiNoExistsWord /\%(^\|[^!]\)\@<='.g:vimwiki_word1.'/'
|
||||
endif
|
||||
execute 'syntax match VimwikiNoExistsWord /'.g:vimwiki_word2.'/'
|
||||
execute 'syntax match VimwikiNoExistsWord /'.g:vimwiki_word3.'/'
|
||||
" till we find them in vimwiki's path
|
||||
call vimwiki#WikiHighlightWords()
|
||||
else
|
||||
" A WikiWord (unqualifiedWikiName)
|
||||
execute 'syntax match VimwikiWord /\%(^\|[^!]\)\@<=\<'.g:vimwiki_word1.'\>/'
|
||||
" A [[bracketed wiki word]]
|
||||
execute 'syntax match VimwikiWord /'.g:vimwiki_word2.'/'
|
||||
endif
|
||||
|
||||
execute 'syntax match VimwikiLink `'.g:vimwiki_rxWeblink.'`'
|
||||
|
||||
" Emoticons
|
||||
syntax match VimwikiEmoticons /\%((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)/
|
||||
|
||||
let g:vimwiki_rxTodo = '\C\%(TODO:\|DONE:\|FIXME:\|FIXED:\|XXX:\)'
|
||||
execute 'syntax match VimwikiTodo /'. g:vimwiki_rxTodo .'/'
|
||||
|
||||
" Load concrete Wiki syntax
|
||||
execute 'runtime! syntax/vimwiki_'.VimwikiGet('syntax').'.vim'
|
||||
|
||||
" Tables
|
||||
execute 'syntax match VimwikiTable /'.g:vimwiki_rxTable.'/'
|
||||
|
||||
" List items
|
||||
execute 'syntax match VimwikiList /'.g:vimwiki_rxListBullet.'/'
|
||||
execute 'syntax match VimwikiList /'.g:vimwiki_rxListNumber.'/'
|
||||
execute 'syntax match VimwikiList /'.g:vimwiki_rxListDefine.'/'
|
||||
|
||||
execute 'syntax match VimwikiBold /'.g:vimwiki_rxBold.'/'
|
||||
|
||||
execute 'syntax match VimwikiItalic /'.g:vimwiki_rxItalic.'/'
|
||||
|
||||
execute 'syntax match VimwikiBoldItalic /'.g:vimwiki_rxBoldItalic.'/'
|
||||
|
||||
execute 'syntax match VimwikiItalicBold /'.g:vimwiki_rxItalicBold.'/'
|
||||
|
||||
execute 'syntax match VimwikiDelText /'.g:vimwiki_rxDelText.'/'
|
||||
|
||||
execute 'syntax match VimwikiSuperScript /'.g:vimwiki_rxSuperScript.'/'
|
||||
|
||||
execute 'syntax match VimwikiSubScript /'.g:vimwiki_rxSubScript.'/'
|
||||
|
||||
execute 'syntax match VimwikiCode /'.g:vimwiki_rxCode.'/'
|
||||
|
||||
" <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 /'.
|
||||
\ g:vimwiki_rxListBullet.'\s*\['.g:vimwiki_listsyms[4].'\].*$/'
|
||||
execute 'syntax match VimwikiCheckBoxDone /'.
|
||||
\ g:vimwiki_rxListNumber.'\s*\['.g:vimwiki_listsyms[4].'\].*$/'
|
||||
endif
|
||||
|
||||
syntax region VimwikiComment start='<!--' end='-->'
|
||||
|
||||
if !vimwiki#hl_exists("VimwikiHeader1")
|
||||
execute 'syntax match VimwikiHeader /'.g:vimwiki_rxHeader.'/'
|
||||
else
|
||||
" Header levels, 1-6
|
||||
execute 'syntax match VimwikiHeader1 /'.g:vimwiki_rxH1.'/'
|
||||
execute 'syntax match VimwikiHeader2 /'.g:vimwiki_rxH2.'/'
|
||||
execute 'syntax match VimwikiHeader3 /'.g:vimwiki_rxH3.'/'
|
||||
execute 'syntax match VimwikiHeader4 /'.g:vimwiki_rxH4.'/'
|
||||
execute 'syntax match VimwikiHeader5 /'.g:vimwiki_rxH5.'/'
|
||||
execute 'syntax match VimwikiHeader6 /'.g:vimwiki_rxH6.'/'
|
||||
endif
|
||||
|
||||
" group names "{{{
|
||||
if !vimwiki#hl_exists("VimwikiHeader1")
|
||||
hi def link VimwikiHeader Title
|
||||
else
|
||||
hi def link VimwikiHeader1 Title
|
||||
hi def link VimwikiHeader2 Title
|
||||
hi def link VimwikiHeader3 Title
|
||||
hi def link VimwikiHeader4 Title
|
||||
hi def link VimwikiHeader5 Title
|
||||
hi def link VimwikiHeader6 Title
|
||||
endif
|
||||
|
||||
hi def VimwikiBold term=bold cterm=bold gui=bold
|
||||
hi def VimwikiItalic term=italic cterm=italic gui=italic
|
||||
hi def VimwikiBoldItalic term=bold cterm=bold gui=bold,italic
|
||||
hi def link VimwikiItalicBold VimwikiBoldItalic
|
||||
|
||||
hi def link VimwikiCode PreProc
|
||||
hi def link VimwikiWord Underlined
|
||||
hi def link VimwikiNoExistsWord Error
|
||||
|
||||
hi def link VimwikiPre SpecialComment
|
||||
hi def link VimwikiLink Underlined
|
||||
hi def link VimwikiList Function
|
||||
hi def link VimwikiCheckBox VimwikiList
|
||||
hi def link VimwikiCheckBoxDone Comment
|
||||
hi def link VimwikiTable PreProc
|
||||
hi def link VimwikiEmoticons Character
|
||||
hi def link VimwikiDelText Constant
|
||||
hi def link VimwikiSuperScript Number
|
||||
hi def link VimwikiSubScript Number
|
||||
hi def link VimwikiTodo Todo
|
||||
hi def link VimwikiComment Comment
|
||||
"}}}
|
||||
|
||||
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,
|
||||
\ '^{{{\%(.*[[:blank:][:punct:]]\)\?'.
|
||||
\ hl_syntax.'\%([[:blank:][:punct:]].*\)\?',
|
||||
\ '^}}}', 'VimwikiPre')
|
||||
endfor
|
||||
endif
|
||||
"}}}
|
76
syntax/vimwiki_default.vim
Normal file
76
syntax/vimwiki_default.vim
Normal file
@ -0,0 +1,76 @@
|
||||
" Vimwiki syntax file
|
||||
" Default syntax
|
||||
" Author: Maxim Kim <habamax@gmail.com>
|
||||
" Home: http://code.google.com/p/vimwiki/
|
||||
" vim:tw=78:
|
||||
|
||||
" text: *strong*
|
||||
" let g:vimwiki_rxBold = '\*[^*]\+\*'
|
||||
let g:vimwiki_rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='.
|
||||
\'\*'.
|
||||
\'\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`]\)'.
|
||||
\'\*'.
|
||||
\'\%([[:punct:]]\|\s\|$\)\@='
|
||||
|
||||
" text: _emphasis_
|
||||
" let g:vimwiki_rxItalic = '_[^_]\+_'
|
||||
let g:vimwiki_rxItalic = '\%(^\|\s\|[[:punct:]]\)\@<='.
|
||||
\'_'.
|
||||
\'\%([^_`[:space:]][^_`]*[^_`[:space:]]\|[^_`]\)'.
|
||||
\'_'.
|
||||
\'\%([[:punct:]]\|\s\|$\)\@='
|
||||
|
||||
" text: *_bold italic_* or _*italic bold*_
|
||||
let g:vimwiki_rxBoldItalic = '\%(^\|\s\|[[:punct:]]\)\@<='.
|
||||
\'\*_'.
|
||||
\'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`]\)'.
|
||||
\'_\*'.
|
||||
\'\%([[:punct:]]\|\s\|$\)\@='
|
||||
|
||||
let g:vimwiki_rxItalicBold = '\%(^\|\s\|[[:punct:]]\)\@<='.
|
||||
\'_\*'.
|
||||
\'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`]\)'.
|
||||
\'\*_'.
|
||||
\'\%([[:punct:]]\|\s\|$\)\@='
|
||||
|
||||
" text: `code`
|
||||
let g:vimwiki_rxCode = '`[^`]\+`'
|
||||
|
||||
" text: ~~deleted text~~
|
||||
let g:vimwiki_rxDelText = '\~\~[^~`]\+\~\~'
|
||||
|
||||
" text: ^superscript^
|
||||
let g:vimwiki_rxSuperScript = '\^[^^`]\+\^'
|
||||
|
||||
" text: ,,subscript,,
|
||||
let g:vimwiki_rxSubScript = ',,[^,`]\+,,'
|
||||
|
||||
" Header levels, 1-6
|
||||
let g:vimwiki_rxH1 = '^\s*=\{1}[^=]\+.*[^=]\+=\{1}\s*$'
|
||||
let g:vimwiki_rxH2 = '^\s*=\{2}[^=]\+.*[^=]\+=\{2}\s*$'
|
||||
let g:vimwiki_rxH3 = '^\s*=\{3}[^=]\+.*[^=]\+=\{3}\s*$'
|
||||
let g:vimwiki_rxH4 = '^\s*=\{4}[^=]\+.*[^=]\+=\{4}\s*$'
|
||||
let g:vimwiki_rxH5 = '^\s*=\{5}[^=]\+.*[^=]\+=\{5}\s*$'
|
||||
let g:vimwiki_rxH6 = '^\s*=\{6}[^=]\+.*[^=]\+=\{6}\s*$'
|
||||
let g:vimwiki_rxHeader = '\%('.g:vimwiki_rxH1.'\)\|'.
|
||||
\ '\%('.g:vimwiki_rxH2.'\)\|'.
|
||||
\ '\%('.g:vimwiki_rxH3.'\)\|'.
|
||||
\ '\%('.g:vimwiki_rxH4.'\)\|'.
|
||||
\ '\%('.g:vimwiki_rxH5.'\)\|'.
|
||||
\ '\%('.g:vimwiki_rxH6.'\)'
|
||||
|
||||
" <hr>, horizontal rule
|
||||
let g:vimwiki_rxHR = '^----.*$'
|
||||
|
||||
" Tables. Each line starts and ends with '||'; each cell is separated by '||'
|
||||
let g:vimwiki_rxTable = '||'
|
||||
|
||||
" List items start with optional whitespace(s) then '* ' or '# '
|
||||
let g:vimwiki_rxListBullet = '^\s*\%(\*\|-\)\s'
|
||||
let g:vimwiki_rxListNumber = '^\s*#\s'
|
||||
|
||||
let g:vimwiki_rxListDefine = '::\(\s\|$\)'
|
||||
|
||||
" Preformatted text
|
||||
let g:vimwiki_rxPreStart = '{{{'
|
||||
let g:vimwiki_rxPreEnd = '}}}'
|
58
syntax/vimwiki_media.vim
Normal file
58
syntax/vimwiki_media.vim
Normal file
@ -0,0 +1,58 @@
|
||||
" Vimwiki syntax file
|
||||
" MediaWiki syntax
|
||||
" Author: Maxim Kim <habamax@gmail.com>
|
||||
" Home: http://code.google.com/p/vimwiki/
|
||||
" vim:tw=78:
|
||||
|
||||
" text: '''strong'''
|
||||
let g:vimwiki_rxBold = "'''[^']\\+'''"
|
||||
|
||||
" text: ''emphasis''
|
||||
let g:vimwiki_rxItalic = "''[^']\\+''"
|
||||
|
||||
" text: '''''strong italic'''''
|
||||
let g:vimwiki_rxBoldItalic = "'''''[^']\\+'''''"
|
||||
let g:vimwiki_rxItalicBold = g:vimwiki_rxBoldItalic
|
||||
|
||||
" text: `code`
|
||||
let g:vimwiki_rxCode = '`[^`]\+`'
|
||||
|
||||
" text: ~~deleted text~~
|
||||
let g:vimwiki_rxDelText = '\~\~[^~]\+\~\~'
|
||||
|
||||
" text: ^superscript^
|
||||
let g:vimwiki_rxSuperScript = '\^[^^]\+\^'
|
||||
|
||||
" text: ,,subscript,,
|
||||
let g:vimwiki_rxSubScript = ',,[^,]\+,,'
|
||||
|
||||
" Header levels, 1-6
|
||||
let g:vimwiki_rxH1 = '^\s*=\{1}[^=]\+.*[^=]\+=\{1}\s*$'
|
||||
let g:vimwiki_rxH2 = '^\s*=\{2}[^=]\+.*[^=]\+=\{2}\s*$'
|
||||
let g:vimwiki_rxH3 = '^\s*=\{3}[^=]\+.*[^=]\+=\{3}\s*$'
|
||||
let g:vimwiki_rxH4 = '^\s*=\{4}[^=]\+.*[^=]\+=\{4}\s*$'
|
||||
let g:vimwiki_rxH5 = '^\s*=\{5}[^=]\+.*[^=]\+=\{5}\s*$'
|
||||
let g:vimwiki_rxH6 = '^\s*=\{6}[^=]\+.*[^=]\+=\{6}\s*$'
|
||||
let g:vimwiki_rxHeader = '\%('.g:vimwiki_rxH1.'\)\|'.
|
||||
\ '\%('.g:vimwiki_rxH2.'\)\|'.
|
||||
\ '\%('.g:vimwiki_rxH3.'\)\|'.
|
||||
\ '\%('.g:vimwiki_rxH4.'\)\|'.
|
||||
\ '\%('.g:vimwiki_rxH5.'\)\|'.
|
||||
\ '\%('.g:vimwiki_rxH6.'\)'
|
||||
|
||||
" <hr>, horizontal rule
|
||||
let g:vimwiki_rxHR = '^----.*$'
|
||||
|
||||
" Tables. Each line starts and ends with '||'; each cell is separated by '||'
|
||||
let g:vimwiki_rxTable = '||'
|
||||
|
||||
" Bulleted list items start with whitespace(s), then '*'
|
||||
" highlight only bullets and digits.
|
||||
let g:vimwiki_rxListBullet = '^\s*\*\+\([^*]*$\)\@='
|
||||
let g:vimwiki_rxListNumber = '^\s*#\+'
|
||||
|
||||
let g:vimwiki_rxListDefine = '^\%(;\|:\)\s'
|
||||
|
||||
" Preformatted text
|
||||
let g:vimwiki_rxPreStart = '<pre>'
|
||||
let g:vimwiki_rxPreEnd = '<\/pre>'
|
Reference in New Issue
Block a user