Fixes for movement options, and better highlighting for "." indexing.
This commit is contained in:
parent
ba1cdee898
commit
1544e284d6
@ -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<"
|
||||
|
@ -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=/\("\.\.\)\@<!"\(\.\."\)\@!/ skip=/\\\\\|\\"/ end=/$\|"/
|
||||
syn region nomsuText start=/\("\.\.\)\@<!"\(\.\."\)\@!/ skip=/\\\\\|\\"/ end=/$\|"/ nextgroup=nomsuIndex
|
||||
\ contains=nomsuInterp,nomsuTextBackslash,nomsuTextEscapedQuote
|
||||
hi nomsuText ctermfg=Gray
|
||||
hi def link nomsuText String
|
||||
syn match nomsuTextWord /\([a-zA-Z_]\|[^\x00-\xff]\)\([a-zA-Z0-9_]\|[^\x00-\xff]\)*/ contained nextgroup=nomsuIndex
|
||||
hi def link nomsuTextWord String
|
||||
|
||||
syn match nomsuVar /%\([a-zA-Z0-9_]\|[^\x00-\xff]\)*/
|
||||
syn match nomsuVar /%\([a-zA-Z0-9_]\|[^\x00-\xff]\)*/ nextgroup=nomsuIndex
|
||||
hi nomsuVar ctermfg=Cyan
|
||||
hi def link nomsuVar Identifier
|
||||
|
||||
syn match nomsuIndex /\./ nextgroup=nomsuVar,nomsuNumber,nomsuParenGroup,nomsuText,nomsuList,nomsuDict,nomsuTextWord
|
||||
hi nomsuIndex ctermfg=Yellow
|
||||
|
||||
syn match nomsuWord /\([a-zA-Z_]\|[^\x00-\xff]\)\([a-zA-Z0-9_]\|[^\x00-\xff]\)*/
|
||||
hi def link nomsuWord Function
|
||||
@ -61,8 +63,8 @@ syn match nomsuOpWord ;\v[`$~!@^&*_+=|<>?'/-]+;
|
||||
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 /\.\./
|
||||
|
Loading…
Reference in New Issue
Block a user