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