diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2022-09-18 15:20:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-18 15:20:20 +0200 |
| commit | 67df3347fd1e637f643b35239f7a20ac813ee588 (patch) | |
| tree | 1dd1a5ca375a24225b86da10d55e7d08306b65bf /runtime/syntax/vdf.vim | |
| parent | 8dc61713d9db433dfa2024b45f3bc590dcb58f83 (diff) | |
| download | rneovim-67df3347fd1e637f643b35239f7a20ac813ee588.tar.gz rneovim-67df3347fd1e637f643b35239f7a20ac813ee588.tar.bz2 rneovim-67df3347fd1e637f643b35239f7a20ac813ee588.zip | |
vim-patch:9712ff1288f9 (#20240)
Update runtime files
https://github.com/vim/vim/commit/9712ff1288f942736ed76c0dec014909f067eec9
Diffstat (limited to 'runtime/syntax/vdf.vim')
| -rw-r--r-- | runtime/syntax/vdf.vim | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/runtime/syntax/vdf.vim b/runtime/syntax/vdf.vim new file mode 100644 index 0000000000..c690b706ea --- /dev/null +++ b/runtime/syntax/vdf.vim @@ -0,0 +1,54 @@ +" Vim syntax file +" Language: Valve Data Format +" Maintainer: ObserverOfTime <chronobserver@disroot.org> +" Filenames: *.vdf +" Last Change: 2022 Sep 15 + +if exists('b:current_syntax') + finish +endif + +let s:cpo_save = &cpoptions +set cpoptions&vim + +" Comment +syn keyword vdfTodo contained TODO FIXME XXX +syn match vdfComment +//.*+ contains=vdfTodo + +" Macro +syn match vdfMacro /^\s*#.*/ + +" Tag +syn region vdfTag start=/"/ skip=/\\"/ end=/"/ + \ nextgroup=vdfValue skipwhite oneline + +" Section +syn region vdfSection matchgroup=vdfBrace + \ start=/{/ end=/}/ transparent fold + \ contains=vdfTag,vdfSection,vdfComment,vdfConditional + +" Conditional +syn match vdfConditional /\[\$\w\{1,1021}\]/ nextgroup=vdfTag + +" Value +syn region vdfValue start=/"/ skip=/\\"/ end=/"/ + \ oneline contained contains=vdfVariable,vdfNumber,vdfEscape +syn region vdfVariable start=/%/ skip=/\\%/ end=/%/ oneline contained +syn match vdfEscape /\\[nt\\"]/ contained +syn match vdfNumber /"-\?\d\+"/ contained + +hi def link vdfBrace Delimiter +hi def link vdfComment Comment +hi def link vdfConditional Constant +hi def link vdfEscape SpecialChar +hi def link vdfMacro Macro +hi def link vdfNumber Number +hi def link vdfTag Keyword +hi def link vdfTodo Todo +hi def link vdfValue String +hi def link vdfVariable Identifier + +let b:current_syntax = 'vdf' + +let &cpoptions = s:cpo_save +unlet s:cpo_save |