" 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 "highlight String ctermbg=DarkBlue ctermfg=Black " Regular strings " syn region nomsuInterp matchgroup=nomsuInterpDelim start=/\\/ end=/\\/ contained \ contains=@nomsuAll hi def link nomsuInterpDelim PreProc syn region nomsuOneLineComment start=/#/ end=/$/ hi def link nomsuOneLineComment Comment syn region nomsuComment start=/#\.\.[^\n]*$\n\(\s*\n\)*\z(\s\+\)\S/ skip=/^\%(\z1\S\|^\s*$\)/ end=/^\z1\@!.*/me=s-1 hi def link nomsuComment Comment syn region nomsuString1 start=/"\(\(\.\."\)\@!\|\.\."\s*|.*$\)/ skip=/\\\\\|\\"/ end=/"/ hi def link nomsuString1 String syn region nomsuStringLine start=/"\.\."/ end=/$/ \ contains=nomsuInterp,nomsuStringLineStart,nomsuStringTrailingSpace,nomsuOneLineComment,nomsuComment hi def link nomsuStringLine String syn match nomsuStringLineStart /\(^[ \t]*\|"\.\."\s*\)\@<=|/ contained hi def link nomsuStringLineStart Delimiter syn match nomsuStringTrailingSpace /[ \t]*$/ contained hi nomsuStringTrailingSpace ctermbg=Magenta syn region nomsuLongString start=/"\.\."[^\n]*$\n\(\s*\n\)*\z(\s\+\)\S/ skip=/^\%(\z1\S\|^\s*$\)/ end=/^\z1\@!.*/me=s-1 \ contains=nomsuInterp,nomsuStringLineStart,nomsuStringTrailingSpace,nomsuOneLineComment,nomsuComment hi def link nomsuLongString String syn match nomsuVar /\v\%[a-zA-Z0-9_'+*/^&$@#-]*/ hi def link nomsuVar Identifier syn match nomsuNumber /\v([a-zA-Z])@