2008-05-04 02:00:00 +02:00
|
|
|
" Vim syntax file
|
|
|
|
" Language: Wiki
|
|
|
|
" Maintainer: Maxim Kim (habamax at gmail dot com)
|
|
|
|
" Home: http://code.google.com/p/vimwiki/
|
|
|
|
" Author: Maxim Kim
|
|
|
|
" Filenames: *.wiki
|
2008-05-05 02:00:00 +02:00
|
|
|
" Last Change: (05.05.2008 19:30)
|
|
|
|
" Version: 0.2
|
2008-05-04 02:00:00 +02:00
|
|
|
" Based on FlexWiki
|
|
|
|
|
|
|
|
" Quit if syntax file is already loaded
|
|
|
|
if version < 600
|
|
|
|
syntax clear
|
|
|
|
elseif exists("b:current_syntax")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
" A WikiWord (unqualifiedWikiName)
|
|
|
|
execute 'syntax match wikiWord /'.g:vimwiki_word1.'/'
|
|
|
|
" A [bracketed wiki word]
|
|
|
|
execute 'syntax match wikiWord /'.g:vimwiki_word2.'/'
|
|
|
|
|
|
|
|
" text: "this is a link (optional tooltip)":http://www.microsoft.com
|
|
|
|
" TODO: check URL syntax against RFC
|
|
|
|
syntax match wikiLink `\("[^"(]\+\((\([^)]\+\))\)\?":\)\?\(https\?\|ftp\|gopher\|telnet\|file\|notes\|ms-help\):\(\(\(//\)\|\(\\\\\)\)\+[A-Za-z0-9:#@%/;$~_?+-=.&\-\\\\]*\)`
|
|
|
|
|
|
|
|
" text: *strong*
|
|
|
|
syntax match wikiBold /\(^\|\W\)\zs\*\([^ ].\{-}\)\*/
|
|
|
|
|
|
|
|
" text: _emphasis_
|
2008-05-05 02:00:00 +02:00
|
|
|
syntax match wikiItalic /_.\{-}_/
|
2008-05-04 02:00:00 +02:00
|
|
|
|
2008-05-05 02:00:00 +02:00
|
|
|
" text: `code`
|
|
|
|
syntax match wikiCode /`.\{-}`/
|
2008-05-04 02:00:00 +02:00
|
|
|
|
2008-05-05 02:00:00 +02:00
|
|
|
" text: ~~deleted text~~
|
|
|
|
syntax match wikiDelText /\~\{2}.\{-}\~\{2}/
|
2008-05-04 02:00:00 +02:00
|
|
|
|
|
|
|
" text: ^superscript^
|
2008-05-05 02:00:00 +02:00
|
|
|
syntax match wikiSuperScript /\^.\{-}\^/
|
2008-05-04 02:00:00 +02:00
|
|
|
|
2008-05-05 02:00:00 +02:00
|
|
|
" text: ,,subscript,,
|
|
|
|
syntax match wikiSubScript /,,.\{-},,/
|
2008-05-04 02:00:00 +02:00
|
|
|
|
|
|
|
" Emoticons: must come after the Textilisms, as later rules take precedence
|
|
|
|
" over earlier ones. This match is an approximation for the ~70 distinct
|
|
|
|
" patterns that FlexWiki knows.
|
|
|
|
syntax match wikiEmoticons /\((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)/
|
|
|
|
|
2008-05-05 02:00:00 +02:00
|
|
|
" Aggregate all the regular text highlighting into wikiText
|
|
|
|
syntax cluster wikiText contains=wikiItalic,wikiBold,wikiCode,wikiDelText,wikiSuperScript,wikiSubScript,wikiLink,wikiWord,wikiEmoticons
|
2008-05-04 02:00:00 +02:00
|
|
|
|
2008-05-05 02:00:00 +02:00
|
|
|
" Treat all other lines that start with spaces as PRE-formatted text.
|
|
|
|
syntax match wikiPre /^[ \t]\+.*$/ contains=@wikiText
|
2008-05-04 02:00:00 +02:00
|
|
|
|
|
|
|
" Header levels, 1-6
|
2008-05-05 02:00:00 +02:00
|
|
|
syntax match wikiH1 /\(^!\{1}.*$\|^\s*=\{1}.*=\{1}\s*$\)/
|
|
|
|
syntax match wikiH2 /\(^!\{2}.*$\|^\s*=\{2}.*=\{2}\s*$\)/
|
|
|
|
syntax match wikiH3 /\(^!\{3}.*$\|^\s*=\{3}.*=\{3}\s*$\)/
|
|
|
|
syntax match wikiH4 /\(^!\{4}.*$\|^\s*=\{4}.*=\{4}\s*$\)/
|
|
|
|
syntax match wikiH5 /\(^!\{5}.*$\|^\s*=\{5}.*=\{5}\s*$\)/
|
|
|
|
syntax match wikiH6 /\(^!\{6}.*$\|^\s*=\{6}.*=\{6}\s*$\)/
|
2008-05-04 02:00:00 +02:00
|
|
|
|
|
|
|
" <hr>, horizontal rule
|
|
|
|
syntax match wikiHR /^----.*$/
|
|
|
|
|
|
|
|
" Tables. Each line starts and ends with '||'; each cell is separated by '||'
|
|
|
|
syntax match wikiTable /||/
|
|
|
|
|
|
|
|
" Bulleted list items start with whitespace(s), then '*'
|
|
|
|
" syntax match wikiList /^\s\+\(\*\|[1-9]\+0*\.\).*$/ contains=@wikiText
|
|
|
|
" highlight only bullets and digits.
|
2008-05-05 02:00:00 +02:00
|
|
|
syntax match wikiList /^\s\+\(\*\|[1-9]\+0*\.\|#\)/
|
2008-05-04 02:00:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Link FlexWiki syntax items to colors
|
|
|
|
hi def link wikiH1 Title
|
|
|
|
hi def link wikiH2 wikiH1
|
|
|
|
hi def link wikiH3 wikiH2
|
|
|
|
hi def link wikiH4 wikiH3
|
|
|
|
hi def link wikiH5 wikiH4
|
|
|
|
hi def link wikiH6 wikiH5
|
|
|
|
hi def link wikiHR wikiH6
|
2008-05-05 02:00:00 +02:00
|
|
|
|
2008-05-04 02:00:00 +02:00
|
|
|
hi def wikiBold term=bold cterm=bold gui=bold
|
|
|
|
hi def wikiItalic term=italic cterm=italic gui=italic
|
|
|
|
|
2008-05-05 02:00:00 +02:00
|
|
|
hi def link wikiCode PreProc
|
2008-05-04 02:00:00 +02:00
|
|
|
hi def link wikiWord Underlined
|
|
|
|
|
|
|
|
hi def link wikiEscape Todo
|
|
|
|
hi def link wikiPre PreProc
|
|
|
|
hi def link wikiLink Underlined
|
|
|
|
hi def link wikiList Type
|
|
|
|
hi def link wikiTable Type
|
|
|
|
hi def link wikiEmoticons Constant
|
|
|
|
hi def link wikiDelText Comment
|
|
|
|
hi def link wikiInsText Constant
|
|
|
|
hi def link wikiSuperScript Constant
|
|
|
|
hi def link wikiSubScript Constant
|
|
|
|
hi def link wikiCitation Constant
|
|
|
|
|
|
|
|
hi def link wikiSingleLineProperty Identifier
|
|
|
|
|
2008-05-06 02:00:00 +02:00
|
|
|
let b:current_syntax="vimwiki"
|
2008-05-04 02:00:00 +02:00
|
|
|
|
|
|
|
" vim:tw=0:
|