2 " Language: OmegaScript
3 " Maintainer: Xapian developers <xapian-discuss@lists.xapian.org>
4 " URL: https://xapian.org/
7 " To install: place this file in ~/.vim/syntax/omegascript.vim
8 " and then create or add the following lines, without the "'s commenting
9 " them out, to ~/.vim/filetype.vim
10 "if exists("did_load_filetypes")
13 "augroup filetypedetect
14 " au! BufRead,BufNewFile */templates/* setfiletype omegascript
17 " For version 5.x: Clear all syntax items
18 " For version 6.x: Quit when a syntax file was already loaded
19 if !exists("main_syntax")
22 elseif exists("b:current_syntax")
25 let main_syntax = 'omegascript'
28 " Include HTML highlighting at the top level
29 runtime! syntax/html.vim
30 unlet b:current_syntax
32 " HTML included in commands.
33 " Just do very basic highlighting, because it is likely to be only a fragment.
34 " We can't even sensibly insist on matching angle brackets.
35 syn match omegaScriptHTML contained +[<>="]+
37 " OmegaScript commands are case sensitive
41 syn match omegaScriptError "[${},]"
42 syn match omegaScriptError2 "[${,]"
43 syn match omegaScriptLiteral "$[$().]"
44 syn match omegaScriptArg contained "\$[1-9_]"
46 syn match omegaScriptCommand "$[a-zA-Z][a-zA-Z]*" contains=omegaScriptCommandKW,omegaScriptCommandKWDeprecated
47 syn match omegaScriptBegin contained "$[a-zA-Z][a-zA-Z]*{"he=e-1 contains=omegaScriptKW
48 syn region omegaScriptItem start="$[a-zA-Z][a-zA-Z]*{" end="}" contains=omegaScriptItem,omegaScriptCommand,omegaScriptBegin,omegaScriptSep,omegaScriptLiteral,omegaScriptArg,omegaScriptError2,omegaScriptHtml,omegaScriptComment keepend extend
49 syn match omegaScriptSep contained ","
50 syn region omegaScriptCommentBracePair start="{"rs=s+2 end="}" contains=omegaScriptCommentBracePair keepend extend
51 syn match omegaScriptCommentStart contained "{"
52 syn region omegaScriptComment matchgroup=omegaScriptCommentStart start="${" end="}" contains=omegaScriptCommentBracePair,omegaScriptComment keepend extend
54 " All keywords which can take parameters
55 syn keyword omegaScriptKW contained @OMEGASCRIPT_PARAM@
57 " All keywords which can take no parameters
58 syn keyword omegaScriptCommandKW contained @OMEGASCRIPT_NO_PARAM@
61 syn keyword omegaScriptCommandKWDeprecated contained freqs
63 hi link omegaScriptCommand Statement
64 hi link omegaScriptBegin Statement
65 hi link omegaScriptItem PreProc
66 hi link omegaScriptLiteral Special
67 hi link omegaScriptKW Type
68 hi link omegaScriptArg Type
69 hi link omegaScriptCommandKW Type
70 hi link omegaScriptCommandKWDeprecated Special
71 hi link omegaScriptSep Normal
72 hi link omegaScriptError Error
73 hi link omegaScriptError2 Error
74 hi link omegaScriptHtml Constant
75 hi link omegaScriptComment Comment
76 hi link omegaScriptCommentBracePair Comment
77 hi link omegaScriptCommentStart Comment
81 let b:current_syntax = "omegascript"
83 if main_syntax == 'omegascript'