Update stdlib highlighting and add folding of objects (#9)

This commit is contained in:
Gustaf Lindstedt 2018-04-11 04:42:10 +02:00 committed by Dave Cunningham
parent 9838a60394
commit 007ee85746
2 changed files with 30 additions and 6 deletions

View File

@ -21,6 +21,10 @@ endfunction
" auto commands
augroup vim-jsonnet
autocmd!
autocmd BufReadPre *.jsonnet setlocal foldmethod=syntax
autocmd BufReadPre *.libsonnet setlocal foldmethod=syntax
autocmd BufReadPre *.jsonnet setlocal foldlevel=100
autocmd BufReadPre *.libsonnet setlocal foldlevel=100
autocmd BufWritePre *.jsonnet call s:fmtAutosave()
autocmd BufWritePre *.libsonnet call s:fmtAutosave()
augroup END

View File

@ -26,6 +26,7 @@ syn match Constant "std.codepoint"
syn match Constant "std.cos"
syn match Constant "std.exp"
syn match Constant "std.exponent"
syn match Constant "std.extVar"
syn match Constant "std.filter"
syn match Constant "std.floor"
syn match Constant "std.force"
@ -33,11 +34,13 @@ syn match Constant "std.length"
syn match Constant "std.log"
syn match Constant "std.makeArray"
syn match Constant "std.mantissa"
syn match Constant "std.objectFields"
syn match Constant "std.objectFieldsAll"
syn match Constant "std.objectHas"
syn match Constant "std.objectHasAll"
syn match Constant "std.md5"
syn match Constant "std.modulo"
syn match Constant "std.native"
syn match Constant "std.objectFieldsEx"
syn match Constant "std.objectHasEx"
syn match Constant "std.pow"
syn match Constant "std.primitiveEquals"
syn match Constant "std.sin"
syn match Constant "std.sqrt"
syn match Constant "std.tan"
@ -46,14 +49,17 @@ syn match Constant "std.type"
" std.jsonnet
syn match Constant "std.abs"
syn match Constant "std.assertEqual"
syn match Constant "std.base64"
syn match Constant "std.base64Decode"
syn match Constant "std.base64DecodeBytes"
syn match Constant "std.assertEqual"
syn match Constant "std.count"
syn match Constant "std.endsWith"
syn match Constant "std.escapeStringBash"
syn match Constant "std.escapeStringDollars"
syn match Constant "std.escapeStringJson"
syn match Constant "std.escapeStringPython"
syn match Constant "std.equals"
syn match Constant "std.filterMap"
syn match Constant "std.flattenArrays"
syn match Constant "std.foldl"
@ -62,22 +68,34 @@ syn match Constant "std.format"
syn match Constant "std.join"
syn match Constant "std.lines"
syn match Constant "std.manifestIni"
syn match Constant "std.manifestJson"
syn match Constant "std.manifestJsonEx"
syn match Constant "std.manifestPython"
syn match Constant "std.manifestPythonVars"
syn match Constant "std.manifestYamlStream"
syn match Constant "std.map"
syn match Constant "std.max"
syn match Constant "std.md5"
syn match Constant "std.mergePatch"
syn match Constant "std.min"
syn match Constant "std.mod"
syn match Constant "std.objectFields"
syn match Constant "std.objectFieldsAll"
syn match Constant "std.objectHas"
syn match Constant "std.objectHasAll"
syn match Constant "std.parseInt"
syn match Constant "std.prune"
syn match Constant "std.range"
syn match Constant "std.resolvePath"
syn match Constant "std.set"
syn match Constant "std.setDiff"
syn match Constant "std.setInter"
syn match Constant "std.setMember"
syn match Constant "std.setUnion"
syn match Constant "std.slice"
syn match Constant "std.sort"
syn match Constant "std.split"
syn match Constant "std.splitLimit"
syn match Constant "std.startsWith"
syn match Constant "std.stringChars"
syn match Constant "std.substr"
syn match Constant "std.toString"
@ -100,6 +118,8 @@ syn match Comment "#.*$"
syn match Keyword "\<[a-zA-Z_][a-z0-9A-Z_]*\s*\(([^)]*)\)\?\s*+\?::\?:\?"
syn region Object start="{" end="}" fold transparent
syntax keyword Include import importstr
syntax keyword Type function self super
syntax keyword Statement assert if then else for in