Version 0.2
* (+) Add part of Google's Wiki syntax. * (+) Add auto insert # with ENTER. * (+) On/Off auto insert bullet with ENTER. * (+) Strip `[[complex wiki name]]` from symbols that cannot be used in file names. * (+) Links to non-wiki files. Non wiki files are files with extensions ie `[[hello world.txt]]` or `[[my homesite.html]]`
This commit is contained in:
@ -4,8 +4,8 @@
|
||||
" Home: http://code.google.com/p/vimwiki/
|
||||
" Author: Maxim Kim
|
||||
" Filenames: *.wiki
|
||||
" Last Change: (04.05.2008 17:45)
|
||||
" Version: 0.1
|
||||
" Last Change: (05.05.2008 19:30)
|
||||
" Version: 0.2
|
||||
" Based on FlexWiki
|
||||
|
||||
" Quit if syntax file is already loaded
|
||||
@ -26,70 +26,51 @@ syntax match wikiLink `\("[^"(]\+\((\([^)]\+\))\)\?":\)\?\(https\?\|ft
|
||||
|
||||
" text: *strong*
|
||||
syntax match wikiBold /\(^\|\W\)\zs\*\([^ ].\{-}\)\*/
|
||||
" '''bold'''
|
||||
syntax match wikiBold /'''\([^'].\{-}\)'''/
|
||||
|
||||
" text: _emphasis_
|
||||
syntax match wikiItalic /\(^\|\W\)\zs_\([^ ].\{-}\)_/
|
||||
" ''italic''
|
||||
syntax match wikiItalic /''\([^'].\{-}\)''/
|
||||
syntax match wikiItalic /_.\{-}_/
|
||||
|
||||
" ``deemphasis``
|
||||
syntax match wikiDeEmphasis /``\([^`].\{-}\)``/
|
||||
" text: `code`
|
||||
syntax match wikiCode /`.\{-}`/
|
||||
|
||||
" text: @code@
|
||||
syntax match wikiCode /\(^\|\s\|(\|\[\)\zs@\([^@]\+\)@/
|
||||
|
||||
" text: -deleted text-
|
||||
syntax match wikiDelText /\(^\|\s\+\)\zs-\([^ <a ]\|[^ <img ]\|[^ -].*\)-/
|
||||
|
||||
" text: +inserted text+
|
||||
syntax match wikiInsText /\(^\|\W\)\zs+\([^ ].\{-}\)+/
|
||||
" text: ~~deleted text~~
|
||||
syntax match wikiDelText /\~\{2}.\{-}\~\{2}/
|
||||
|
||||
" text: ^superscript^
|
||||
syntax match wikiSuperScript /\(^\|\W\)\zs^\([^ ].\{-}\)^/
|
||||
syntax match wikiSuperScript /\^.\{-}\^/
|
||||
|
||||
" text: ~subscript~
|
||||
syntax match wikiSubScript /\(^\|\W\)\zs\~\([^ ].\{-}\)\~/
|
||||
|
||||
" text: ??citation??
|
||||
syntax match wikiCitation /\(^\|\W\)\zs??\([^ ].\{-}\)??/
|
||||
" text: ,,subscript,,
|
||||
syntax match wikiSubScript /,,.\{-},,/
|
||||
|
||||
" 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()\]|$@]\|;)\|:'(\)/
|
||||
|
||||
" Aggregate all the regular text highlighting into flexwikiText
|
||||
syntax cluster wikiText contains=wikiItalic,wikiBold,wikiCode,wikiDeEmphasis,wikiDelText,wikiInsText,wikiSuperScript,wikiSubScript,wikiCitation,wikiLink,wikiWord,wikiEmoticons
|
||||
" Aggregate all the regular text highlighting into wikiText
|
||||
syntax cluster wikiText contains=wikiItalic,wikiBold,wikiCode,wikiDelText,wikiSuperScript,wikiSubScript,wikiLink,wikiWord,wikiEmoticons
|
||||
|
||||
" single-line WikiPropertys
|
||||
syntax match wikiSingleLineProperty /^:\?[A-Z_][_a-zA-Z0-9]\+:/
|
||||
" Treat all other lines that start with spaces as PRE-formatted text.
|
||||
syntax match wikiPre /^[ \t]\+.*$/ contains=@wikiText
|
||||
|
||||
" Header levels, 1-6
|
||||
syntax match wikiH1 /^!.*$/
|
||||
syntax match wikiH2 /^!!.*$/
|
||||
syntax match wikiH3 /^!!!.*$/
|
||||
syntax match wikiH4 /^!!!!.*$/
|
||||
syntax match wikiH5 /^!!!!!.*$/
|
||||
syntax match wikiH6 /^!!!!!!.*$/
|
||||
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*$\)/
|
||||
|
||||
" <hr>, horizontal rule
|
||||
syntax match wikiHR /^----.*$/
|
||||
|
||||
" Formatting can be turned off by ""enclosing it in pairs of double quotes""
|
||||
syntax match wikiEscape /"".\{-}""/
|
||||
|
||||
" Tables. Each line starts and ends with '||'; each cell is separated by '||'
|
||||
syntax match wikiTable /||/
|
||||
|
||||
" Treat all other lines that start with spaces as PRE-formatted text.
|
||||
syntax match wikiPre /^[ \t]\+.*$/
|
||||
|
||||
" Bulleted list items start with whitespace(s), then '*'
|
||||
" syntax match wikiList /^\s\+\(\*\|[1-9]\+0*\.\).*$/ contains=@wikiText
|
||||
" highlight only bullets and digits.
|
||||
syntax match wikiList /^\s\+\(\*\|[1-9]\+0*\.\)/
|
||||
syntax match wikiList /^\s\+\(\*\|[1-9]\+0*\.\|#\)/
|
||||
|
||||
|
||||
|
||||
@ -102,11 +83,11 @@ hi def link wikiH4 wikiH3
|
||||
hi def link wikiH5 wikiH4
|
||||
hi def link wikiH6 wikiH5
|
||||
hi def link wikiHR wikiH6
|
||||
|
||||
|
||||
hi def wikiBold term=bold cterm=bold gui=bold
|
||||
hi def wikiItalic term=italic cterm=italic gui=italic
|
||||
|
||||
hi def link wikiCode Statement
|
||||
hi def link wikiCode PreProc
|
||||
hi def link wikiWord Underlined
|
||||
|
||||
hi def link wikiEscape Todo
|
||||
@ -116,7 +97,6 @@ hi def link wikiList Type
|
||||
hi def link wikiTable Type
|
||||
hi def link wikiEmoticons Constant
|
||||
hi def link wikiDelText Comment
|
||||
hi def link wikiDeEmphasis Comment
|
||||
hi def link wikiInsText Constant
|
||||
hi def link wikiSuperScript Constant
|
||||
hi def link wikiSubScript Constant
|
||||
|
Reference in New Issue
Block a user