robin/laufey

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

zeertzjqvim-patch:f83e00b: runtime(xslt,xsd): speed up highlighting by optimizing lookbehinds in patternse59684318e

master
1.2 KiB39 linesraw
1" Vim syntax file
2" Language:	XSD (XML Schema)
3" Maintainer:	Christian Brabandt <cb@256bit.org>
4" Repository:	https://github.com/chrisbra/vim-xml-ftplugin
5" Previous Maintainer:	Johannes Zellner <johannes@zellner.org>
6" Last Change:	21 Jun 2026
7" Filenames:	*.xsd
8" REFERENCES:
9"   [1] http://www.w3.org/TR/xmlschema-0
10"
11
12" Quit when a syntax file was already loaded
13if exists("b:current_syntax")
14    finish
15endif
16
17runtime! syntax/xml.vim
18
19syn cluster xmlTagHook add=xsdElement
20syn case match
21
22for s:element in [
23    \ 'all', 'annotation', 'any', 'anyAttribute', 'appInfo', 'attribute',
24    \ 'attributeGroup', 'choice', 'complexContent', 'complexType',
25    \ 'documentation', 'element', 'enumeration', 'extension', 'field', 'group',
26    \ 'import', 'include', 'key', 'keyref', 'length', 'list', 'maxInclusive',
27    \ 'maxLength', 'minInclusive', 'minLength', 'pattern', 'redefine',
28    \ 'restriction', 'schema', 'selector', 'sequence', 'simpleContent',
29    \ 'simpleType', 'union', 'unique',
30    \ ]
31    execute 'syn match xsdElement contained /\%#=1\%([</]xsd:\)\@5<=' . s:element . '[^ /!?<>"'']\@!/'
32endfor
33unlet s:element
34
35hi def link xsdElement Statement
36
37let b:current_syntax = 'xsd'
38
39" vim: ts=8