diff --git a/ftplugin/nomsu.vim b/ftplugin/nomsu.vim index dd26e2b..e29352f 100644 --- a/ftplugin/nomsu.vim +++ b/ftplugin/nomsu.vim @@ -8,7 +8,8 @@ endif let b:did_ftplugin = 1 setlocal formatoptions-=t -setlocal iskeyword=46,58,44,40,41,34,91,92,93 +setlocal iskeyword+=% +setlocal cpoptions+=M let b:undo_ftplugin = "setlocal formatoptions<" diff --git a/syntax/nomsu.vim b/syntax/nomsu.vim index ea29b18..a431eb8 100644 --- a/syntax/nomsu.vim +++ b/syntax/nomsu.vim @@ -19,40 +19,42 @@ hi nomsuComment ctermfg=DarkBlue hi def link nomsuComment Comment -syn region nomsuList start=/\[/ end=/$\|\]/ contains=@nomsuAll,nomsuComma +syn region nomsuList start=/\[/ end=/$\|\]/ contains=@nomsuAll,nomsuComma nextgroup=nomsuIndex hi nomsuList ctermfg=Blue -syn region nomsuDict start=/{/ end=/$\|}/ contains=nomsuColon,nomsuComma,@nomsuAll +syn region nomsuDict start=/{/ end=/$\|}/ contains=nomsuColon,nomsuComma,@nomsuAll nextgroup=nomsuIndex hi nomsuDict ctermfg=Green -syn region nomsuParenGroup start=/(/ end=/$\|)/ contains=@nomsuAll +syn region nomsuParenGroup start=/(/ end=/$\|)/ contains=@nomsuAll nextgroup=nomsuIndex hi nomsuParenGroup ctermfg=Yellow -syn match nomsuLongTextStart /"\.\."/ contains=nomsuIndentor contained -hi nomsuLongTextStart ctermfg=Gray +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=Brown +hi nomsuInterp ctermfg=Gray syn region nomsuInterpDotDot matchgroup=nomsuInterpDelim start=/\\$/ end=/\.\./ contained syn region nomsuLongTextValue start=/^/ end=/$/ contained \ contains=nomsuInterp,nomsuInterpDotDot,nomsuTextBackslash -hi nomsuLongTextValue ctermfg=Gray -hi def link nomsuLongTextValue Text +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\+\)\?\)\?/ -syn match nomsuNumber /-\?\.\d\+/ +syn match nomsuNumber /-\?\d\+\(\.\(\d\+\)\?\)\?/ nextgroup=nomsuIndex +syn match nomsuNumber /-\?\.\d\+/ nextgroup=nomsuIndex hi def link nomsuNumber Number syn match nomsuDotDot /\.\./