" 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 nomsuLongTextStart /"$/ contained hi def link nomsuLongTextStart String 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 /\\/ nextgroup=nomsuTextEscapedChar contained hi nomsuTextEscape ctermfg=Gray syn match nomsuInterp /\\\([[{($:]\)\@=/ nextgroup=nomsuVar,nomsuList,nomsuDict,nomsuParenGroup,nomsuIndentedBlock contained hi nomsuInterp ctermfg=Gray syn region nomsuInterpDotDot matchgroup=nomsuInterpDelim start=/\\\s*$/ end=/\.\./ contained hi nomsuInterpDotDot ctermfg=Gray syn region nomsuLongTextValue start=/^/ end=/$/ contained \ contains=nomsuInterp,nomsuInterpDotDot,nomsuTextBackslash hi def link nomsuLongTextValue String syn region nomsuLongText start=/\(^\z(\s*\)[^\n]*\)\@<="$/ skip=/\n\s*$/ end=/\n\(\z1\s\)\@!"\?/ \ contains=nomsuLongTextStart,nomsuLongTextValue syn region nomsuText start=/"\($\)\@!/ skip=/\\./ end=/"/ contains=nomsuInterp,nomsuTextEscape hi def link nomsuText String syn region nomsuIndentedBlock start=/\(^\z(\s*\)[^\n]*\)\@<=:\s*$/ skip=/\n\s*$/ end=/\n\(\z1\s\)\@!\(\s*\.\.\)\?/ \ contains=@nomsuAll syn match nomsuVar /\$\((\([ a-zA-Z0-9_`~!@^&*_+=|<>?'/-]\|[^\x00-\xff]\)\+)\|\([a-zA-Z0-9_-]\|[^\x00-\xff]\)\+\)\?/ \ contains=nomsuDollarSign,nomsuVarParens hi nomsuVar ctermfg=Cyan hi def link nomsuVar Identifier 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*\)\@