diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 08:50:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 08:50:31 +0000 |
commit | aed8ce9da277f5ecffe968b324f242c41c3b752a (patch) | |
tree | d2e538394cb7a8a7c42a4aac6ccf1a8e3256999b /runtime/syntax/rnc.vim | |
parent | Initial commit. (diff) | |
download | vim-upstream.tar.xz vim-upstream.zip |
Adding upstream version 2:9.0.1378.upstream/2%9.0.1378upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/syntax/rnc.vim')
-rw-r--r-- | runtime/syntax/rnc.vim | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/runtime/syntax/rnc.vim b/runtime/syntax/rnc.vim new file mode 100644 index 0000000..7d3907e --- /dev/null +++ b/runtime/syntax/rnc.vim @@ -0,0 +1,68 @@ +" Vim syntax file +" Language: Relax NG compact syntax +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2007-06-17 + +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +setlocal iskeyword+=-,. + +syn keyword rncTodo contained TODO FIXME XXX NOTE + +syn region rncComment display oneline start='^\s*#' end='$' + \ contains=rncTodo,@Spell + +syn match rncOperator display '[-|,&+?*~]' +syn match rncOperator display '\%(|&\)\==' +syn match rncOperator display '>>' + +syn match rncNamespace display '\<\k\+:' + +syn match rncQuoted display '\\\k\+\>' + +syn match rncSpecial display '\\x{\x\+}' + +syn region rncAnnotation transparent start='\[' end='\]' + \ contains=ALLBUT,rncComment,rncTodo + +syn region rncLiteral display oneline start=+"+ end=+"+ + \ contains=rncSpecial +syn region rncLiteral display oneline start=+'+ end=+'+ +syn region rncLiteral display oneline start=+"""+ end=+"""+ + \ contains=rncSpecial +syn region rncLiteral display oneline start=+'''+ end=+'''+ + +syn match rncDelimiter display '[{},()]' + +syn keyword rncKeyword datatypes default div empty external grammar +syn keyword rncKeyword include inherit list mixed name namespace +syn keyword rncKeyword notAllowed parent start string text token + +syn match rncIdentifier display '\k\+\_s*\%(=\|&=\||=\)\@=' + \ nextgroup=rncOperator +syn keyword rncKeyword element attribute + \ nextgroup=rncIdName skipwhite skipempty +syn match rncIdName contained '\k\+' + +hi def link rncTodo Todo +hi def link rncComment Comment +hi def link rncOperator Operator +hi def link rncNamespace Identifier +hi def link rncQuoted Special +hi def link rncSpecial SpecialChar +hi def link rncAnnotation Special +hi def link rncLiteral String +hi def link rncDelimiter Delimiter +hi def link rncKeyword Keyword +hi def link rncIdentifier Identifier +hi def link rncIdName Identifier + +let b:current_syntax = "rnc" + +let &cpo = s:cpo_save +unlet s:cpo_save |