neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

rnc.vim (2263B)


      1 " Vim syntax file
      2 " Language:             Relax NG compact syntax
      3 " Previous Maintainer:  Nikolai Weibull <now@bitwi.se>
      4 " Latest Revision:      2007-06-17
      5 
      6 if exists("b:current_syntax")
      7  finish
      8 endif
      9 
     10 let s:cpo_save = &cpo
     11 set cpo&vim
     12 
     13 setlocal iskeyword+=-,.
     14 
     15 syn keyword rncTodo         contained TODO FIXME XXX NOTE
     16 
     17 syn region  rncComment      display oneline start='^\s*#' end='$'
     18                            \ contains=rncTodo,@Spell
     19 
     20 syn match   rncOperator     display '[-|,&+?*~]'
     21 syn match   rncOperator     display '\%(|&\)\=='
     22 syn match   rncOperator     display '>>'
     23 
     24 syn match   rncNamespace    display '\<\k\+:'
     25 
     26 syn match   rncQuoted       display '\\\k\+\>'
     27 
     28 syn match   rncSpecial      display '\\x{\x\+}'
     29 
     30 syn region rncAnnotation    transparent start='\[' end='\]'
     31                            \ contains=ALLBUT,rncComment,rncTodo
     32 
     33 syn region  rncLiteral      display oneline start=+"+ end=+"+
     34                            \ contains=rncSpecial
     35 syn region  rncLiteral      display oneline start=+'+ end=+'+
     36 syn region  rncLiteral      display oneline start=+"""+ end=+"""+
     37                            \ contains=rncSpecial
     38 syn region  rncLiteral      display oneline start=+'''+ end=+'''+
     39 
     40 syn match   rncDelimiter    display '[{},()]'
     41 
     42 syn keyword rncKeyword      datatypes default div empty external grammar
     43 syn keyword rncKeyword      include inherit list mixed name namespace
     44 syn keyword rncKeyword      notAllowed parent start string text token
     45 
     46 syn match   rncIdentifier   display '\k\+\_s*\%(=\|&=\||=\)\@='
     47                            \ nextgroup=rncOperator
     48 syn keyword rncKeyword      element attribute
     49                            \ nextgroup=rncIdName skipwhite skipempty
     50 syn match   rncIdName       contained '\k\+'
     51 
     52 hi def link rncTodo         Todo
     53 hi def link rncComment      Comment
     54 hi def link rncOperator     Operator
     55 hi def link rncNamespace    Identifier
     56 hi def link rncQuoted       Special
     57 hi def link rncSpecial      SpecialChar
     58 hi def link rncAnnotation   Special
     59 hi def link rncLiteral      String
     60 hi def link rncDelimiter    Delimiter
     61 hi def link rncKeyword      Keyword
     62 hi def link rncIdentifier   Identifier
     63 hi def link rncIdName       Identifier
     64 
     65 let b:current_syntax = "rnc"
     66 
     67 let &cpo = s:cpo_save
     68 unlet s:cpo_save