Improved syntax file and ftplugin for SnipMate snippets.

This commit is contained in:
Vanillma 2024-07-15 20:11:42 +04:30 committed by L3MON4D3
parent ce0a05ab4e
commit 9470235d76
2 changed files with 4 additions and 6 deletions

View file

@ -5,10 +5,9 @@ if exists("b:did_ftplugin")
endif
let b:did_ftplugin = 1
let b:undo_ftplugin = "setl et< sts< cms< fdm< fde<"
let b:undo_ftplugin = "setl cms< fdm< fde<"
" Use hard tabs
setlocal noexpandtab softtabstop=0
setlocal foldmethod=expr foldexpr=getline(v:lnum)=~'^#\\\|^e\\\|^p'?0:getline(v:lnum)!~'^\\t\\\|^\ \\\|^$'?'>1':1
setlocal commentstring=#\ %s
setlocal nospell

View file

@ -8,14 +8,13 @@ syn match snipCommand '\%(\\\@<!\%(\\\\\)*\)\@<=`.\{-}\%(\\\@<!\%(\\\\\)*\)\@<=`
syn match snippet '^snippet.*' contains=multiSnipText,snipKeyword
syn match snippet '^autosnippet.*' contains=multiSnipText,snipKeyword
syn match snippet '^extends.*' contains=snipKeyword
syn match snippet '^version.*' contains=snipKeyword
syn match snippet '^priority.*' contains=snipKeyword,priority
syn match priority '\d\+' contained
syn match multiSnipText '\S\+ \zs.*' contained
syn match snipKeyword '^(snippet|extends|version|autosnippet|priority)'me=s+8 contained
syn match snipKeyword '^\%(snippet\|extends\|autosnippet\|priority\)' contained
" normally we'd want a \s in that group, but that doesn't work => cover common
" cases with \t and " ".
syn match snipError "^[^#vsaep\t ].*$"
syn match snipError '^[^#saep\t ].*$'
hi link snippet Identifier
hi link snipComment Comment