" Language: Nomsu " Maintainer: Bruce Hill " License: WTFPL " Bail if our syntax is already loaded. if exists('b:current_syntax') && b:current_syntax == 'nomsu' finish endif " Highlight long strings. syn sync minlines=100 "hi def link nomsuInterpDelim PreProc hi nomsuInterpDelim ctermfg=Gray "syn region nomsuOneLineComment start=/#/ end=/$/ "hi nomsuOneLineComment ctermfg=DarkBlue "hi def link nomsuOneLineComment Comment syn region nomsuComment start=/\%(^\z(\s*\)\)\@<=#/ skip=/\n\s*$/ end=/\n\%(\z1\s\)\@!/ hi nomsuComment ctermfg=DarkBlue hi def link nomsuComment Comment syn region nomsuList start=/\[/ end=/\]/ contains=@nomsuAll hi nomsuList ctermfg=Blue syn region nomsuDict start=/{/ end=/}/ contains=@nomsuAll hi nomsuDict ctermfg=Green syn region nomsuParenGroup start=/(/ end=/)/ contains=@nomsuAll hi nomsuParenGroup ctermfg=Yellow syn match nomsuTextBackslash /\\\%(\\\|;\)\@=/ nextgroup=nomsuTextEscapedBackslash contained hi nomsuTextBackslash ctermfg=Gray syn match nomsuTextEscapedChar /\%(\\\)\@<=\%(\x\{1,3}\|x\x\{1,2}\|.\)/ contained hi nomsuTextEscapedChar cterm=bold ctermfg=Blue syn match nomsuTextEscapedBackslash /./ contained hi nomsuTextEscapedBackslash cterm=bold ctermfg=Blue syn match nomsuTextEscape /\\\%(\x\{1,3}\|x\x\{1,2}\|.\)/ contains=nomsuTextEscapedChar contained hi nomsuTextEscape ctermfg=Gray syn match nomsuInterp /\\\%([[{($:]\)\@=/ nextgroup=nomsuVar,nomsuList,nomsuDict,nomsuParenGroup,nomsuIndentedInterpBlock contained hi nomsuInterp ctermfg=Gray syn region nomsuInterpDotDot matchgroup=nomsuInterpDelim start=/\\\s*$/ end=/\.\./ contained hi nomsuInterpDotDot ctermfg=Gray syn region nomsuIndentedText matchgroup=nomsuTextQuotes start=/\%(^\z(\(\s*\)\)[^\n]*\)\@<=("$/ end=/^\z1")/ \ contains=nomsuInterp,nomsuInterpDotDot,nomsuTextBackslash hi def link nomsuIndentedText String hi nomsuTextQuotes ctermfg=DarkMagenta syn region nomsuText matchgroup=nomsuTextQuotes start=/"\%($\)\@!/ end=/"/ contains=nomsuInterp,nomsuTextEscape hi def link nomsuText String syn region nomsuIndentedBlock start=/\%(^\z(\s*\)[^\n]*\)\@<=:\s*$/ end=/\n\%(\z1\s\)\@!\%(\s*\.\.\)\?/ \ contains=@nomsuAll syn region nomsuIndentedInterpBlock matchgroup=nomsuColon start=/:\s*$/ end=/\n\s*\.\./ contained \ contains=@nomsuAll syn match nomsuVar /\$\%(\%([a-zA-Z0-9_-]\|[^\x00-\xff]\)\+\|(\@!\)/ \ contains=nomsuDollarSign,nomsuVarParens hi nomsuVar ctermfg=Cyan hi def link nomsuVar Identifier syn region nomsuActionVar matchgroup=nomsuVar start=/\$(/ end=/)/ contains=nomsuVarWord,nomsuVarWord,@nomsuAll syn match nomsuDollarSign /\$/ contained hi nomsuDollarSign ctermfg=Cyan syn match nomsuVarParens /[()]/ contained hi nomsuVarParens ctermfg=LightCyan syn match nomsuWord /\%([a-zA-Z_]\|[^\x00-\xff]\)\%([a-zA-Z0-9_]\|[^\x00-\xff]\)*/ hi def link nomsuWord Function hi nomsuWord ctermfg=White syn match nomsuOpWord ;[`~!@^&*_+=<>?'/-]\+\|\%(^\s*\)\@?'/-]\+\|\%(^\s*\)\@