robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqMerge pull request #41207 from zeertzjq/vim-bfc76045117b04745

master
1.2 KiB31 linesraw
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
7if !exists('main_syntax')
8  if exists('b:current_syntax')
9    finish
10  endif
11  let main_syntax = 'jsonld'
12endif
13
14runtime! syntax/json.vim
15unlet! 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.
19syn match jsonldKeyword /\C\%(\\"\)\@<!"\@<=@\%(base\|container\|context\|direction\|graph\|id\)\ze"/ contained containedin=jsonKeyword,jsonString
20syn match jsonldKeyword /\C\%(\\"\)\@<!"\@<=@\%(import\|included\|index\|json\|language\|list\)\ze"/ contained containedin=jsonKeyword,jsonString
21syn match jsonldKeyword /\C\%(\\"\)\@<!"\@<=@\%(nest\|none\|prefix\|propagate\|protected\|reverse\)\ze"/ contained containedin=jsonKeyword,jsonString
22syn match jsonldKeyword /\C\%(\\"\)\@<!"\@<=@\%(set\|type\|value\|version\|vocab\)\ze"/ contained containedin=jsonKeyword,jsonString
23
24hi def link jsonldKeyword SpecialChar
25
26let b:current_syntax = 'jsonld'
27if main_syntax ==# 'jsonld'
28  unlet main_syntax
29endif
30
31" vim: ts=8