vim

Fork of vim, an acceptable text editor
git clone git://git.laack.co/vim.git
Log | Files | Refs | README | LICENSE

jsonld.vim (1198B)


      1 " Vim syntax file
      2 " Language:	JSON-LD
      3 " Maintainer:	The Vim Project <https://github.com/vim/vim>
      4 " Last Change:	2026 Aug 06
      5 " Reference:	https://www.w3.org/TR/json-ld11/
      6 
      7 if !exists('main_syntax')
      8   if exists('b:current_syntax')
      9     finish
     10   endif
     11   let main_syntax = 'jsonld'
     12 endif
     13 
     14 runtime! syntax/json.vim
     15 unlet! b:current_syntax
     16 
     17 " Match reserved keywords only when they occupy a complete JSON string.  The
     18 " negative lookbehind excludes an escaped quote inside a longer string.
     19 syn match jsonldKeyword /\C\%(\\"\)\@<!"\@<=@\%(base\|container\|context\|direction\|graph\|id\)\ze"/ contained containedin=jsonKeyword,jsonString
     20 syn match jsonldKeyword /\C\%(\\"\)\@<!"\@<=@\%(import\|included\|index\|json\|language\|list\)\ze"/ contained containedin=jsonKeyword,jsonString
     21 syn match jsonldKeyword /\C\%(\\"\)\@<!"\@<=@\%(nest\|none\|prefix\|propagate\|protected\|reverse\)\ze"/ contained containedin=jsonKeyword,jsonString
     22 syn match jsonldKeyword /\C\%(\\"\)\@<!"\@<=@\%(set\|type\|value\|version\|vocab\)\ze"/ contained containedin=jsonKeyword,jsonString
     23 
     24 hi def link jsonldKeyword SpecialChar
     25 
     26 let b:current_syntax = 'jsonld'
     27 if main_syntax ==# 'jsonld'
     28   unlet main_syntax
     29 endif
     30 
     31 " vim: ts=8