" 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 syn region nomsuOneLineComment start=/#/ end=/$/ hi nomsuOneLineComment ctermfg=DarkBlue hi def link nomsuOneLineComment Comment syn region nomsuComment start=/\(^\z(\s*\)[^\n]*\)\@<=#/ skip=/\n\s*$/ end=/\n\(\z1\s\)\@!/ hi nomsuComment ctermfg=DarkBlue hi def link nomsuComment Comment syn region nomsuList start=/\[/ end=/$\|\]/ contains=@nomsuAll,nomsuComma nextgroup=nomsuIndex hi nomsuList ctermfg=Blue syn region nomsuDict start=/{/ end=/$\|}/ contains=nomsuColon,nomsuComma,@nomsuAll nextgroup=nomsuIndex hi nomsuDict ctermfg=Green syn region nomsuParenGroup start=/(/ end=/$\|)/ contains=@nomsuAll nextgroup=nomsuIndex hi nomsuParenGroup ctermfg=Yellow syn match nomsuLongTextStart /"\.\."/ contains=nomsuDotDot contained hi def link nomsuLongTextStart String syn match nomsuTextBackslash /\\\\/ contained hi nomsuTextBackslash ctermfg=Blue syn match nomsuTextEscapedQuote /\\"/ contained hi nomsuTextEscapedQuote ctermfg=Blue syn match nomsuInterp /\\\([%[{"(]\)\@=/ nextgroup=nomsuVar,nomsuText,nomsuList,nomsuDict,nomsuParenGroup contained hi nomsuInterp ctermfg=Gray syn region nomsuInterpDotDot matchgroup=nomsuInterpDelim start=/\\$/ end=/\.\./ contained syn region nomsuLongTextValue start=/^/ end=/$/ contained \ contains=nomsuInterp,nomsuInterpDotDot,nomsuTextBackslash hi def link nomsuLongTextValue String syn region nomsuLongText start=/\(^\z(\s*\)[^\n]*\)\@<="\.\."/ skip=/^\s*$/ end=/^\(\z1\s\)\@!/ \ contains=nomsuLongTextStart,nomsuLongTextValue syn region nomsuText start=/\("\.\.\)\@?'/-]+; hi def link nomsuOpWord Function hi nomsuOpWord ctermfg=LightYellow syn match nomsuNumber /-\?\d\+\(\.\(\d\+\)\?\)\?/ nextgroup=nomsuIndex syn match nomsuNumber /-\?\.\d\+/ nextgroup=nomsuIndex hi def link nomsuNumber Number syn match nomsuDotDot /\.\./ hi def link nomsuDotDot Special hi nomsuDotDot ctermfg=DarkGray syn match nomsuComma /,/ hi nomsuComma ctermfg=Blue hi def link nomsuComma Delimiter syn match nomsuColon /:/ hi nomsuColon ctermfg=Yellow hi def link nomsuColon Delimiter syn match nomsuSemicolon /;/ hi nomsuSemicolon ctermfg=Blue hi def link nomsuSemicolon Delimiter syn cluster nomsuAll contains=nomsuParenGroup,nomsuText,nomsuLongText,nomsuComment,nomsuOneLineComment, \ nomsuVar,nomsuNumber,nomsuDict,nomsuList,nomsuColon,nomsuSemicolon, \ nomsuDotDot,nomsuWord,nomsuOpWord if !exists('b:current_syntax') let b:current_syntax = 'nomsu' endif