Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
flexwiki.vim134 linesDownload Raw Back to syntax
1" Vim syntax file2" Language:     FlexWiki, http://www.flexwiki.com/3" Maintainer:   George V. Reilly  <george@reilly.org>4" Home:         http://www.georgevreilly.com/vim/flexwiki/5" Other Home:   http://www.vim.org/scripts/script.php?script_id=15296" Author:       George V. Reilly7" Filenames:    *.wiki8" Last Change: Wed Apr 26 11:00 PM 2006 P9" Version:      0.310 11" Note: The horrible regexps were reverse-engineered from12" FlexWikiCore\EngineSource\Formatter.cs, with help from the Regex Analyzer13" in The Regulator, http://regulator.sourceforge.net/  .NET uses Perl-style14" regexes, which use a different syntax than Vim (fewer \s).15" The primary test case is FlexWiki\FormattingRules.wiki16 17" quit when a syntax file was already loaded18if exists("b:current_syntax")19    finish20endif21 22" A WikiWord (unqualifiedWikiName)23syntax match  flexwikiWord          /\%(_\?\([A-Z]\{2,}[a-z0-9]\+[A-Za-z0-9]*\)\|\([A-Z][a-z0-9]\+[A-Za-z0-9]*[A-Z]\+[A-Za-z0-9]*\)\)/24" A [bracketed wiki word]25syntax match  flexwikiWord          /\[[[:alnum:]\s]\+\]/26 27" text: "this is a link (optional tooltip)":http://www.microsoft.com28" TODO: check URL syntax against RFC29syntax match flexwikiLink           `\("[^"(]\+\((\([^)]\+\))\)\?":\)\?\(https\?\|ftp\|gopher\|telnet\|file\|notes\|ms-help\):\(\(\(//\)\|\(\\\\\)\)\+[A-Za-z0-9:#@%/;$~_?+-=.&\-\\\\]*\)`30 31" text: *strong* 32syntax match flexwikiBold           /\(^\|\W\)\zs\*\([^ ].\{-}\)\*/33" '''bold'''34syntax match flexwikiBold           /'''\([^'].\{-}\)'''/35 36" text: _emphasis_37syntax match flexwikiItalic         /\(^\|\W\)\zs_\([^ ].\{-}\)_/38" ''italic''39syntax match flexwikiItalic         /''\([^'].\{-}\)''/40 41" ``deemphasis``42syntax match flexwikiDeEmphasis     /``\([^`].\{-}\)``/43 44" text: @code@ 45syntax match flexwikiCode           /\(^\|\s\|(\|\[\)\zs@\([^@]\+\)@/46 47"   text: -deleted text- 48syntax match flexwikiDelText        /\(^\|\s\+\)\zs-\([^ <a ]\|[^ <img ]\|[^ -].*\)-/49 50"   text: +inserted text+ 51syntax match flexwikiInsText        /\(^\|\W\)\zs+\([^ ].\{-}\)+/52 53"   text: ^superscript^ 54syntax match flexwikiSuperScript    /\(^\|\W\)\zs^\([^ ].\{-}\)^/55 56"   text: ~subscript~ 57syntax match flexwikiSubScript      /\(^\|\W\)\zs\~\([^ ].\{-}\)\~/58 59"   text: ??citation?? 60syntax match flexwikiCitation       /\(^\|\W\)\zs??\([^ ].\{-}\)??/61 62" Emoticons: must come after the Textilisms, as later rules take precedence63" over earlier ones. This match is an approximation for the ~70 distinct64" patterns that FlexWiki knows.65syntax match flexwikiEmoticons      /\((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)/66 67" Aggregate all the regular text highlighting into flexwikiText68syntax cluster flexwikiText contains=flexwikiItalic,flexwikiBold,flexwikiCode,flexwikiDeEmphasis,flexwikiDelText,flexwikiInsText,flexwikiSuperScript,flexwikiSubScript,flexwikiCitation,flexwikiLink,flexwikiWord,flexwikiEmoticons69 70" single-line WikiProperties71syntax match flexwikiSingleLineProperty /^:\?[A-Z_][_a-zA-Z0-9]\+:/72 73" TODO: multi-line WikiProperties74 75" Header levels, 1-676syntax match flexwikiH1             /^!.*$/77syntax match flexwikiH2             /^!!.*$/78syntax match flexwikiH3             /^!!!.*$/79syntax match flexwikiH4             /^!!!!.*$/80syntax match flexwikiH5             /^!!!!!.*$/81syntax match flexwikiH6             /^!!!!!!.*$/82 83" <hr>, horizontal rule84syntax match flexwikiHR             /^----.*$/85 86" Formatting can be turned off by ""enclosing it in pairs of double quotes""87syntax match flexwikiEscape         /"".\{-}""/88 89" Tables. Each line starts and ends with '||'; each cell is separated by '||'90syntax match flexwikiTable          /||/91 92" Bulleted list items start with one or tabs, followed by whitespace, then '*'93" Numeric  list items start with one or tabs, followed by whitespace, then '1.'94" Eight spaces at the beginning of the line is equivalent to the leading tab.95syntax match flexwikiList           /^\(\t\| \{8}\)\s*\(\*\|1\.\).*$/   contains=@flexwikiText96 97" Treat all other lines that start with spaces as PRE-formatted text.98syntax match flexwikiPre            /^[ \t]\+[^ \t*1].*$/99 100 101" Link FlexWiki syntax items to colors102hi def link flexwikiH1                    Title103hi def link flexwikiH2                    flexwikiH1104hi def link flexwikiH3                    flexwikiH2105hi def link flexwikiH4                    flexwikiH3106hi def link flexwikiH5                    flexwikiH4107hi def link flexwikiH6                    flexwikiH5108hi def link flexwikiHR                    flexwikiH6109    110hi def flexwikiBold                       term=bold cterm=bold gui=bold111hi def flexwikiItalic                     term=italic cterm=italic gui=italic112 113hi def link flexwikiCode                  Statement114hi def link flexwikiWord                  Underlined115 116hi def link flexwikiEscape                Todo117hi def link flexwikiPre                   PreProc118hi def link flexwikiLink                  Underlined119hi def link flexwikiList                  Type120hi def link flexwikiTable                 Type121hi def link flexwikiEmoticons             Constant122hi def link flexwikiDelText               Comment123hi def link flexwikiDeEmphasis            Comment124hi def link flexwikiInsText               Constant125hi def link flexwikiSuperScript           Constant126hi def link flexwikiSubScript             Constant127hi def link flexwikiCitation              Constant128 129hi def link flexwikiSingleLineProperty    Identifier130 131let b:current_syntax="FlexWiki"132 133" vim:tw=0:134 
codekingpro/portable-devtools · Team Ai