diff options
| author | Adam Stankiewicz <sheerun@sher.pl> | 2013-09-12 16:17:03 +0200 | 
|---|---|---|
| committer | Adam Stankiewicz <sheerun@sher.pl> | 2013-09-12 16:17:03 +0200 | 
| commit | 01fe1500df97577452f755b526c09d8ed0c802ea (patch) | |
| tree | 9e2e038630cc9e82abcd17da6dd3407a9b3bc62a /syntax | |
| parent | dce12af91b404835938e95de9e6d839d52487ed5 (diff) | |
| download | vim-polyglot-01fe1500df97577452f755b526c09d8ed0c802ea.tar.gz vim-polyglot-01fe1500df97577452f755b526c09d8ed0c802ea.zip | |
Add support for basic languages
coffee, cucumbeer, eruby, haml, haskell, javascript,
json, less, nginx, ocaml, ruby, sass, scss, slim,
stylus, textile, tmux
Diffstat (limited to '')
| -rwxr-xr-x | syntax/coffee.vim | 223 | ||||
| -rw-r--r-- | syntax/cucumber.vim | 136 | ||||
| -rw-r--r-- | syntax/eruby.vim | 74 | ||||
| -rw-r--r-- | syntax/haml.vim | 109 | ||||
| -rw-r--r-- | syntax/haskell.vim | 359 | ||||
| -rw-r--r-- | syntax/javascript.vim | 312 | ||||
| -rw-r--r-- | syntax/json.vim | 77 | ||||
| -rw-r--r-- | syntax/less.vim | 64 | ||||
| -rw-r--r-- | syntax/nginx.vim | 664 | ||||
| -rw-r--r-- | syntax/ocaml.vim | 331 | ||||
| -rw-r--r-- | syntax/ruby.vim | 369 | ||||
| -rw-r--r-- | syntax/sass.vim | 100 | ||||
| -rw-r--r-- | syntax/scss.vim | 20 | ||||
| -rw-r--r-- | syntax/slim.vim | 98 | ||||
| -rw-r--r-- | syntax/stylus.vim | 372 | ||||
| -rw-r--r-- | syntax/textile.vim | 91 | ||||
| -rw-r--r-- | syntax/tmux.vim | 104 | 
17 files changed, 3503 insertions, 0 deletions
| diff --git a/syntax/coffee.vim b/syntax/coffee.vim new file mode 100755 index 00000000..eea50840 --- /dev/null +++ b/syntax/coffee.vim @@ -0,0 +1,223 @@ +" Language:    CoffeeScript +" Maintainer:  Mick Koch <kchmck@gmail.com> +" URL:         http://github.com/kchmck/vim-coffee-script +" License:     WTFPL + +" Bail if our syntax is already loaded. +if exists('b:current_syntax') && b:current_syntax == 'coffee' +  finish +endif + +" Include JavaScript for coffeeEmbed. +syn include @coffeeJS syntax/javascript.vim +silent! unlet b:current_syntax + +" Highlight long strings. +syntax sync fromstart + +" CoffeeScript identifiers can have dollar signs. +setlocal isident+=$ + +" These are `matches` instead of `keywords` because vim's highlighting +" priority for keywords is higher than matches. This causes keywords to be +" highlighted inside matches, even if a match says it shouldn't contain them -- +" like with coffeeAssign and coffeeDot. +syn match coffeeStatement /\<\%(return\|break\|continue\|throw\)\>/ display +hi def link coffeeStatement Statement + +syn match coffeeRepeat /\<\%(for\|while\|until\|loop\)\>/ display +hi def link coffeeRepeat Repeat + +syn match coffeeConditional /\<\%(if\|else\|unless\|switch\|when\|then\)\>/ +\                           display +hi def link coffeeConditional Conditional + +syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display +hi def link coffeeException Exception + +syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\)\>/ +\                       display +" The `own` keyword is only a keyword after `for`. +syn match coffeeKeyword /\<for\s\+own\>/ contained containedin=coffeeRepeat +\                       display +hi def link coffeeKeyword Keyword + +syn match coffeeOperator /\<\%(instanceof\|typeof\|delete\)\>/ display +hi def link coffeeOperator Operator + +" The first case matches symbol operators only if they have an operand before. +syn match coffeeExtendedOp /\%(\S\s*\)\@<=[+\-*/%&|\^=!<>?.]\{-1,}\|[-=]>\|--\|++\|:/ +\                          display +syn match coffeeExtendedOp /\<\%(and\|or\)=/ display +hi def link coffeeExtendedOp coffeeOperator + +" This is separate from `coffeeExtendedOp` to help differentiate commas from +" dots. +syn match coffeeSpecialOp /[,;]/ display +hi def link coffeeSpecialOp SpecialChar + +syn match coffeeBoolean /\<\%(true\|on\|yes\|false\|off\|no\)\>/ display +hi def link coffeeBoolean Boolean + +syn match coffeeGlobal /\<\%(null\|undefined\)\>/ display +hi def link coffeeGlobal Type + +" A special variable +syn match coffeeSpecialVar /\<\%(this\|prototype\|arguments\)\>/ display +hi def link coffeeSpecialVar Special + +" An @-variable +syn match coffeeSpecialIdent /@\%(\I\i*\)\?/ display +hi def link coffeeSpecialIdent Identifier + +" A class-like name that starts with a capital letter +syn match coffeeObject /\<\u\w*\>/ display +hi def link coffeeObject Structure + +" A constant-like name in SCREAMING_CAPS +syn match coffeeConstant /\<\u[A-Z0-9_]\+\>/ display +hi def link coffeeConstant Constant + +" A variable name +syn cluster coffeeIdentifier contains=coffeeSpecialVar,coffeeSpecialIdent, +\                                     coffeeObject,coffeeConstant + +" A non-interpolated string +syn cluster coffeeBasicString contains=@Spell,coffeeEscape +" An interpolated string +syn cluster coffeeInterpString contains=@coffeeBasicString,coffeeInterp + +" Regular strings +syn region coffeeString start=/"/ skip=/\\\\\|\\"/ end=/"/ +\                       contains=@coffeeInterpString +syn region coffeeString start=/'/ skip=/\\\\\|\\'/ end=/'/ +\                       contains=@coffeeBasicString +hi def link coffeeString String + +" A integer, including a leading plus or minus +syn match coffeeNumber /\i\@<![-+]\?\d\+\%([eE][+-]\?\d\+\)\?/ display +" A hex, binary, or octal number +syn match coffeeNumber /\<0[xX]\x\+\>/ display +syn match coffeeNumber /\<0[bB][01]\+\>/ display +syn match coffeeNumber /\<0[oO][0-7]\+\>/ display +hi def link coffeeNumber Number + +" A floating-point number, including a leading plus or minus +syn match coffeeFloat /\i\@<![-+]\?\d*\.\@<!\.\d\+\%([eE][+-]\?\d\+\)\?/ +\                     display +hi def link coffeeFloat Float + +" An error for reserved keywords, taken from the RESERVED array: +" http://coffeescript.org/documentation/docs/lexer.html#section-67 +syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\|implements\|interface\|package\|private\|protected\|public\|static\|yield\)\>/ +\                             display +hi def link coffeeReservedError Error + +" A normal object assignment +syn match coffeeObjAssign /@\?\I\i*\s*\ze::\@!/ contains=@coffeeIdentifier display +hi def link coffeeObjAssign Identifier + +syn keyword coffeeTodo TODO FIXME XXX contained +hi def link coffeeTodo Todo + +syn match coffeeComment /#.*/ contains=@Spell,coffeeTodo +hi def link coffeeComment Comment + +syn region coffeeBlockComment start=/####\@!/ end=/###/ +\                             contains=@Spell,coffeeTodo +hi def link coffeeBlockComment coffeeComment + +" A comment in a heregex +syn region coffeeHeregexComment start=/#/ end=/\ze\/\/\/\|$/ contained +\                               contains=@Spell,coffeeTodo +hi def link coffeeHeregexComment coffeeComment + +" Embedded JavaScript +syn region coffeeEmbed matchgroup=coffeeEmbedDelim +\                      start=/`/ skip=/\\\\\|\\`/ end=/`/ keepend +\                      contains=@coffeeJS +hi def link coffeeEmbedDelim Delimiter + +syn region coffeeInterp matchgroup=coffeeInterpDelim start=/#{/ end=/}/ contained +\                       contains=@coffeeAll +hi def link coffeeInterpDelim PreProc + +" A string escape sequence +syn match coffeeEscape /\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\./ contained display +hi def link coffeeEscape SpecialChar + +" A regex -- must not follow a parenthesis, number, or identifier, and must not +" be followed by a number +syn region coffeeRegex start=#\%(\%()\|\i\@<!\d\)\s*\|\i\)\@<!/=\@!\s\@!# +\                      end=#/[gimy]\{,4}\d\@!# +\                      oneline contains=@coffeeBasicString,coffeeRegexCharSet +syn region coffeeRegexCharSet start=/\[/ end=/]/ contained +\                             contains=@coffeeBasicString +hi def link coffeeRegex String +hi def link coffeeRegexCharSet coffeeRegex + +" A heregex +syn region coffeeHeregex start=#///# end=#///[gimy]\{,4}# +\                        contains=@coffeeInterpString,coffeeHeregexComment, +\                                  coffeeHeregexCharSet +\                        fold +syn region coffeeHeregexCharSet start=/\[/ end=/]/ contained +\                               contains=@coffeeInterpString +hi def link coffeeHeregex coffeeRegex +hi def link coffeeHeregexCharSet coffeeHeregex + +" Heredoc strings +syn region coffeeHeredoc start=/"""/ end=/"""/ contains=@coffeeInterpString +\                        fold +syn region coffeeHeredoc start=/'''/ end=/'''/ contains=@coffeeBasicString +\                        fold +hi def link coffeeHeredoc String + +" An error for trailing whitespace, as long as the line isn't just whitespace +syn match coffeeSpaceError /\S\@<=\s\+$/ display +hi def link coffeeSpaceError Error + +" An error for trailing semicolons, for help transitioning from JavaScript +syn match coffeeSemicolonError /;$/ display +hi def link coffeeSemicolonError Error + +" Ignore reserved words in dot accesses. +syn match coffeeDotAccess /\.\@<!\.\s*\I\i*/he=s+1 contains=@coffeeIdentifier +hi def link coffeeDotAccess coffeeExtendedOp + +" Ignore reserved words in prototype accesses. +syn match coffeeProtoAccess /::\s*\I\i*/he=s+2 contains=@coffeeIdentifier +hi def link coffeeProtoAccess coffeeExtendedOp + +" This is required for interpolations to work. +syn region coffeeCurlies matchgroup=coffeeCurly start=/{/ end=/}/ +\                        contains=@coffeeAll +syn region coffeeBrackets matchgroup=coffeeBracket start=/\[/ end=/\]/ +\                         contains=@coffeeAll +syn region coffeeParens matchgroup=coffeeParen start=/(/ end=/)/ +\                       contains=@coffeeAll + +" These are highlighted the same as commas since they tend to go together. +hi def link coffeeBlock coffeeSpecialOp +hi def link coffeeBracket coffeeBlock +hi def link coffeeCurly coffeeBlock +hi def link coffeeParen coffeeBlock + +" This is used instead of TOP to keep things coffee-specific for good +" embedding. `contained` groups aren't included. +syn cluster coffeeAll contains=coffeeStatement,coffeeRepeat,coffeeConditional, +\                              coffeeException,coffeeKeyword,coffeeOperator, +\                              coffeeExtendedOp,coffeeSpecialOp,coffeeBoolean, +\                              coffeeGlobal,coffeeSpecialVar,coffeeSpecialIdent, +\                              coffeeObject,coffeeConstant,coffeeString, +\                              coffeeNumber,coffeeFloat,coffeeReservedError, +\                              coffeeObjAssign,coffeeComment,coffeeBlockComment, +\                              coffeeEmbed,coffeeRegex,coffeeHeregex, +\                              coffeeHeredoc,coffeeSpaceError, +\                              coffeeSemicolonError,coffeeDotAccess, +\                              coffeeProtoAccess,coffeeCurlies,coffeeBrackets, +\                              coffeeParens + +if !exists('b:current_syntax') +  let b:current_syntax = 'coffee' +endif diff --git a/syntax/cucumber.vim b/syntax/cucumber.vim new file mode 100644 index 00000000..c5bde9e5 --- /dev/null +++ b/syntax/cucumber.vim @@ -0,0 +1,136 @@ +" Vim syntax file +" Language:     Cucumber +" Maintainer:   Tim Pope <vimNOSPAM@tpope.org> +" Filenames:    *.feature +" Last Change:	2010 May 21 + +if exists("b:current_syntax") +    finish +endif +syn case match +syn sync minlines=20 + +let g:cucumber_languages = { +      \"en": {"and": "And\\>", "background": "Background\\>", "but": "But\\>", "examples": "Scenarios\\>\\|Examples\\>", "feature": "Business Need\\>\\|Feature\\>\\|Ability\\>", "given": "Given\\>", "scenario": "Scenario\\>", "scenario_outline": "Scenario Template\\>\\|Scenario Outline\\>", "then": "Then\\>", "when": "When\\>"}, +      \"ar": {"and": "\\%u0648\\>", "background": "\\%u0627\\%u0644\\%u062e\\%u0644\\%u0641\\%u064a\\%u0629\\>", "but": "\\%u0644\\%u0643\\%u0646\\>", "examples": "\\%u0627\\%u0645\\%u062b\\%u0644\\%u0629\\>", "feature": "\\%u062e\\%u0627\\%u0635\\%u064a\\%u0629\\>", "given": "\\%u0628\\%u0641\\%u0631\\%u0636\\>", "scenario": "\\%u0633\\%u064a\\%u0646\\%u0627\\%u0631\\%u064a\\%u0648\\>", "scenario_outline": "\\%u0633\\%u064a\\%u0646\\%u0627\\%u0631\\%u064a\\%u0648 \\%u0645\\%u062e\\%u0637\\%u0637\\>", "then": "\\%u0627\\%u0630\\%u0627\\%u064b\\>\\|\\%u062b\\%u0645\\>", "when": "\\%u0639\\%u0646\\%u062f\\%u0645\\%u0627\\>\\|\\%u0645\\%u062a\\%u0649\\>"}, +      \"bg": {"and": "\\%u0418\\>", "background": "\\%u041f\\%u0440\\%u0435\\%u0434\\%u0438\\%u0441\\%u0442\\%u043e\\%u0440\\%u0438\\%u044f\\>", "but": "\\%u041d\\%u043e\\>", "examples": "\\%u041f\\%u0440\\%u0438\\%u043c\\%u0435\\%u0440\\%u0438\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0438\\%u043e\\%u043d\\%u0430\\%u043b\\%u043d\\%u043e\\%u0441\\%u0442\\>", "given": "\\%u0414\\%u0430\\%u0434\\%u0435\\%u043d\\%u043e\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\>", "scenario_outline": "\\%u0420\\%u0430\\%u043c\\%u043a\\%u0430 \\%u043d\\%u0430 \\%u0441\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\>", "then": "\\%u0422\\%u043e\\>", "when": "\\%u041a\\%u043e\\%u0433\\%u0430\\%u0442\\%u043e\\>"}, +      \"bm": {"and": "Dan\\>", "background": "Latar Belakang\\>", "but": "Tetapi\\>", "examples": "Contoh \\>", "feature": "Fungsi\\>", "given": "Bagi\\>", "scenario": "Senario\\>", "scenario_outline": "Menggariskan Senario \\>", "then": "Kemudian\\>", "when": "Apabila\\>"}, +      \"ca": {"and": "I\\>", "background": "Antecedents\\>\\|Rerefons\\>", "but": "Per\\%u00f2\\>", "examples": "Exemples\\>", "feature": "Caracter\\%u00edstica\\>\\|Funcionalitat\\>", "given": "At\\%u00e8s\\>\\|Donada\\>\\|Donat\\>\\|Atesa\\>", "scenario": "Escenari\\>", "scenario_outline": "Esquema de l'escenari\\>", "then": "Aleshores\\>\\|Cal\\>", "when": "Quan\\>"}, +      \"cs": {"and": "A tak\\%u00e9\\>\\|A\\>", "background": "Pozad\\%u00ed\\>\\|Kontext\\>", "but": "Ale\\>", "examples": "P\\%u0159\\%u00edklady\\>", "feature": "Po\\%u017eadavek\\>", "given": "Za p\\%u0159edpokladu\\>\\|Pokud\\>", "scenario": "Sc\\%u00e9n\\%u00e1\\%u0159\\>", "scenario_outline": "N\\%u00e1\\%u010drt Sc\\%u00e9n\\%u00e1\\%u0159e\\>\\|Osnova sc\\%u00e9n\\%u00e1\\%u0159e\\>", "then": "Pak\\>", "when": "Kdy\\%u017e\\>"}, +      \"cy-GB": {"and": "A\\>", "background": "Cefndir\\>", "but": "Ond\\>", "examples": "Enghreifftiau\\>", "feature": "Arwedd\\>", "given": "Anrhegedig a\\>", "scenario": "Scenario\\>", "scenario_outline": "Scenario Amlinellol\\>", "then": "Yna\\>", "when": "Pryd\\>"}, +      \"da": {"and": "Og\\>", "background": "Baggrund\\>", "but": "Men\\>", "examples": "Eksempler\\>", "feature": "Egenskab\\>", "given": "Givet\\>", "scenario": "Scenarie\\>", "scenario_outline": "Abstrakt Scenario\\>", "then": "S\\%u00e5\\>", "when": "N\\%u00e5r\\>"}, +      \"de": {"and": "Und\\>", "background": "Grundlage\\>", "but": "Aber\\>", "examples": "Beispiele\\>", "feature": "Funktionalit\\%u00e4t\\>", "given": "Gegeben sei\\>\\|Angenommen\\>", "scenario": "Szenario\\>", "scenario_outline": "Szenariogrundriss\\>", "then": "Dann\\>", "when": "Wenn\\>"}, +      \"el": {"and": "\\%u039a\\%u03b1\\%u03b9\\>", "background": "\\%u03a5\\%u03c0\\%u03cc\\%u03b2\\%u03b1\\%u03b8\\%u03c1\\%u03bf\\>", "but": "\\%u0391\\%u03bb\\%u03bb\\%u03ac\\>", "examples": "\\%u03a0\\%u03b1\\%u03c1\\%u03b1\\%u03b4\\%u03b5\\%u03af\\%u03b3\\%u03bc\\%u03b1\\%u03c4\\%u03b1\\>\\|\\%u03a3\\%u03b5\\%u03bd\\%u03ac\\%u03c1\\%u03b9\\%u03b1\\>", "feature": "\\%u0394\\%u03c5\\%u03bd\\%u03b1\\%u03c4\\%u03cc\\%u03c4\\%u03b7\\%u03c4\\%u03b1\\>\\|\\%u039b\\%u03b5\\%u03b9\\%u03c4\\%u03bf\\%u03c5\\%u03c1\\%u03b3\\%u03af\\%u03b1\\>", "given": "\\%u0394\\%u03b5\\%u03b4\\%u03bf\\%u03bc\\%u03ad\\%u03bd\\%u03bf\\%u03c5 \\%u03cc\\%u03c4\\%u03b9\\>\\|\\%u0394\\%u03b5\\%u03b4\\%u03bf\\%u03bc\\%u03ad\\%u03bd\\%u03bf\\%u03c5\\>", "scenario": "\\%u03a3\\%u03b5\\%u03bd\\%u03ac\\%u03c1\\%u03b9\\%u03bf\\>", "scenario_outline": "\\%u03a0\\%u03b5\\%u03c1\\%u03b9\\%u03b3\\%u03c1\\%u03b1\\%u03c6\\%u03ae \\%u03a3\\%u03b5\\%u03bd\\%u03b1\\%u03c1\\%u03af\\%u03bf\\%u03c5\\>", "then": "\\%u03a4\\%u03cc\\%u03c4\\%u03b5\\>", "when": "\\%u038c\\%u03c4\\%u03b1\\%u03bd\\>"}, +      \"en-Scouse": {"and": "An\\>", "background": "Dis is what went down\\>", "but": "Buh\\>", "examples": "Examples\\>", "feature": "Feature\\>", "given": "Youse know when youse got\\>\\|Givun\\>", "scenario": "The thing of it is\\>", "scenario_outline": "Wharrimean is\\>", "then": "Den youse gotta\\>\\|Dun\\>", "when": "Youse know like when\\>\\|Wun\\>"}, +      \"en-au": {"and": "Too right\\>", "background": "First off\\>", "but": "Yeah nah\\>", "examples": "You'll wanna\\>", "feature": "Pretty much\\>", "given": "Y'know\\>", "scenario": "Awww, look mate\\>", "scenario_outline": "Reckon it's like\\>", "then": "But at the end of the day I reckon\\>", "when": "It's just unbelievable\\>"}, +      \"en-lol": {"and": "AN\\>", "background": "B4\\>", "but": "BUT\\>", "examples": "EXAMPLZ\\>", "feature": "OH HAI\\>", "given": "I CAN HAZ\\>", "scenario": "MISHUN\\>", "scenario_outline": "MISHUN SRSLY\\>", "then": "DEN\\>", "when": "WEN\\>"}, +      \"en-old": {"and": "Ond\\>\\|7\\>", "background": "\\%u00c6r\\>\\|Aer\\>", "but": "Ac\\>", "examples": "Se \\%u00f0e\\>\\|Se \\%u00fee\\>\\|Se the\\>", "feature": "Hw\\%u00e6t\\>\\|Hwaet\\>", "given": "\\%u00d0urh\\>\\|\\%u00deurh\\>\\|Thurh\\>", "scenario": "Swa\\>", "scenario_outline": "Swa hw\\%u00e6r swa\\>\\|Swa hwaer swa\\>", "then": "\\%u00d0a \\%u00f0e\\>\\|\\%u00dea \\%u00fee\\>\\|\\%u00dea\\>\\|\\%u00d0a\\>\\|Tha the\\>\\|Tha\\>", "when": "\\%u00d0a\\>\\|\\%u00dea\\>\\|Tha\\>"}, +      \"en-pirate": {"and": "Aye\\>", "background": "Yo-ho-ho\\>", "but": "Avast!\\>", "examples": "Dead men tell no tales\\>", "feature": "Ahoy matey!\\>", "given": "Gangway!\\>", "scenario": "Heave to\\>", "scenario_outline": "Shiver me timbers\\>", "then": "Let go and haul\\>", "when": "Blimey!\\>"}, +      \"en-tx": {"and": "And y'all\\>", "background": "Background\\>", "but": "But y'all\\>", "examples": "Examples\\>", "feature": "Feature\\>", "given": "Given y'all\\>", "scenario": "Scenario\\>", "scenario_outline": "All y'all\\>", "then": "Then y'all\\>", "when": "When y'all\\>"}, +      \"eo": {"and": "Kaj\\>", "background": "Fono\\>", "but": "Sed\\>", "examples": "Ekzemploj\\>", "feature": "Trajto\\>", "given": "Donita\\%u0135o\\>", "scenario": "Scenaro\\>", "scenario_outline": "Konturo de la scenaro\\>", "then": "Do\\>", "when": "Se\\>"}, +      \"es": {"and": "Y\\>", "background": "Antecedentes\\>", "but": "Pero\\>", "examples": "Ejemplos\\>", "feature": "Caracter\\%u00edstica\\>", "given": "Dadas\\>\\|Dados\\>\\|Dada\\>\\|Dado\\>", "scenario": "Escenario\\>", "scenario_outline": "Esquema del escenario\\>", "then": "Entonces\\>", "when": "Cuando\\>"}, +      \"et": {"and": "Ja\\>", "background": "Taust\\>", "but": "Kuid\\>", "examples": "Juhtumid\\>", "feature": "Omadus\\>", "given": "Eeldades\\>", "scenario": "Stsenaarium\\>", "scenario_outline": "Raamstsenaarium\\>", "then": "Siis\\>", "when": "Kui\\>"}, +      \"fa": {"and": "\\%u0648\\>", "background": "\\%u0632\\%u0645\\%u06cc\\%u0646\\%u0647\\>", "but": "\\%u0627\\%u0645\\%u0627\\>", "examples": "\\%u0646\\%u0645\\%u0648\\%u0646\\%u0647 \\%u0647\\%u0627\\>", "feature": "\\%u0648\\%u0650\\%u06cc\\%u0698\\%u06af\\%u06cc\\>", "given": "\\%u0628\\%u0627 \\%u0641\\%u0631\\%u0636\\>", "scenario": "\\%u0633\\%u0646\\%u0627\\%u0631\\%u06cc\\%u0648\\>", "scenario_outline": "\\%u0627\\%u0644\\%u06af\\%u0648\\%u06cc \\%u0633\\%u0646\\%u0627\\%u0631\\%u06cc\\%u0648\\>", "then": "\\%u0622\\%u0646\\%u06af\\%u0627\\%u0647\\>", "when": "\\%u0647\\%u0646\\%u06af\\%u0627\\%u0645\\%u06cc\\>"}, +      \"fi": {"and": "Ja\\>", "background": "Tausta\\>", "but": "Mutta\\>", "examples": "Tapaukset\\>", "feature": "Ominaisuus\\>", "given": "Oletetaan\\>", "scenario": "Tapaus\\>", "scenario_outline": "Tapausaihio\\>", "then": "Niin\\>", "when": "Kun\\>"}, +      \"fr": {"and": "Et\\>", "background": "Contexte\\>", "but": "Mais\\>", "examples": "Exemples\\>", "feature": "Fonctionnalit\\%u00e9\\>", "given": "\\%u00c9tant donn\\%u00e9es\\>\\|\\%u00c9tant donn\\%u00e9s\\>\\|\\%u00c9tant donn\\%u00e9e\\>\\|\\%u00c9tant donn\\%u00e9\\>\\|Etant donn\\%u00e9es\\>\\|Etant donn\\%u00e9s\\>\\|Etant donn\\%u00e9e\\>\\|Etant donn\\%u00e9\\>\\|Soit\\>", "scenario": "Sc\\%u00e9nario\\>", "scenario_outline": "Plan du sc\\%u00e9nario\\>\\|Plan du Sc\\%u00e9nario\\>", "then": "Alors\\>", "when": "Lorsqu'\\|Lorsque\\>\\|Quand\\>"}, +      \"gl": {"and": "E\\>", "background": "Contexto\\>", "but": "Mais\\>\\|Pero\\>", "examples": "Exemplos\\>", "feature": "Caracter\\%u00edstica\\>", "given": "Dadas\\>\\|Dados\\>\\|Dada\\>\\|Dado\\>", "scenario": "Escenario\\>", "scenario_outline": "Esbozo do escenario\\>", "then": "Ent\\%u00f3n\\>\\|Logo\\>", "when": "Cando\\>"}, +      \"he": {"and": "\\%u05d5\\%u05d2\\%u05dd\\>", "background": "\\%u05e8\\%u05e7\\%u05e2\\>", "but": "\\%u05d0\\%u05d1\\%u05dc\\>", "examples": "\\%u05d3\\%u05d5\\%u05d2\\%u05de\\%u05d0\\%u05d5\\%u05ea\\>", "feature": "\\%u05ea\\%u05db\\%u05d5\\%u05e0\\%u05d4\\>", "given": "\\%u05d1\\%u05d4\\%u05d9\\%u05e0\\%u05ea\\%u05df\\>", "scenario": "\\%u05ea\\%u05e8\\%u05d7\\%u05d9\\%u05e9\\>", "scenario_outline": "\\%u05ea\\%u05d1\\%u05e0\\%u05d9\\%u05ea \\%u05ea\\%u05e8\\%u05d7\\%u05d9\\%u05e9\\>", "then": "\\%u05d0\\%u05d6\\%u05d9\\>\\|\\%u05d0\\%u05d6\\>", "when": "\\%u05db\\%u05d0\\%u05e9\\%u05e8\\>"}, +      \"hi": {"and": "\\%u0924\\%u0925\\%u093e\\>\\|\\%u0914\\%u0930\\>", "background": "\\%u092a\\%u0943\\%u0937\\%u094d\\%u0920\\%u092d\\%u0942\\%u092e\\%u093f\\>", "but": "\\%u092a\\%u0930\\>", "examples": "\\%u0909\\%u0926\\%u093e\\%u0939\\%u0930\\%u0923\\>", "feature": "\\%u0930\\%u0942\\%u092a \\%u0932\\%u0947\\%u0916\\>", "given": "\\%u091a\\%u0942\\%u0902\\%u0915\\%u093f\\>\\|\\%u092f\\%u0926\\%u093f\\>\\|\\%u0905\\%u0917\\%u0930\\>", "scenario": "\\%u092a\\%u0930\\%u093f\\%u0926\\%u0943\\%u0936\\%u094d\\%u092f\\>", "scenario_outline": "\\%u092a\\%u0930\\%u093f\\%u0926\\%u0943\\%u0936\\%u094d\\%u092f \\%u0930\\%u0942\\%u092a\\%u0930\\%u0947\\%u0916\\%u093e\\>", "then": "\\%u0924\\%u092c\\>", "when": "\\%u091c\\%u092c\\>"}, +      \"hr": {"and": "I\\>", "background": "Pozadina\\>", "but": "Ali\\>", "examples": "Scenariji\\>\\|Primjeri\\>", "feature": "Mogu\\%u0107nost\\>\\|Mogucnost\\>\\|Osobina\\>", "given": "Zadano\\>\\|Zadani\\>\\|Zadan\\>", "scenario": "Scenarij\\>", "scenario_outline": "Koncept\\>\\|Skica\\>", "then": "Onda\\>", "when": "Kada\\>\\|Kad\\>"}, +      \"hu": {"and": "\\%u00c9s\\>", "background": "H\\%u00e1tt\\%u00e9r\\>", "but": "De\\>", "examples": "P\\%u00e9ld\\%u00e1k\\>", "feature": "Jellemz\\%u0151\\>", "given": "Amennyiben\\>\\|Adott\\>", "scenario": "Forgat\\%u00f3k\\%u00f6nyv\\>", "scenario_outline": "Forgat\\%u00f3k\\%u00f6nyv v\\%u00e1zlat\\>", "then": "Akkor\\>", "when": "Amikor\\>\\|Majd\\>\\|Ha\\>"}, +      \"id": {"and": "Dan\\>", "background": "Dasar\\>", "but": "Tapi\\>", "examples": "Contoh\\>", "feature": "Fitur\\>", "given": "Dengan\\>", "scenario": "Skenario\\>", "scenario_outline": "Skenario konsep\\>", "then": "Maka\\>", "when": "Ketika\\>"}, +      \"is": {"and": "Og\\>", "background": "Bakgrunnur\\>", "but": "En\\>", "examples": "Atbur\\%u00f0ar\\%u00e1sir\\>\\|D\\%u00e6mi\\>", "feature": "Eiginleiki\\>", "given": "Ef\\>", "scenario": "Atbur\\%u00f0ar\\%u00e1s\\>", "scenario_outline": "L\\%u00fdsing Atbur\\%u00f0ar\\%u00e1sar\\>\\|L\\%u00fdsing D\\%u00e6ma\\>", "then": "\\%u00de\\%u00e1\\>", "when": "\\%u00deegar\\>"}, +      \"it": {"and": "E\\>", "background": "Contesto\\>", "but": "Ma\\>", "examples": "Esempi\\>", "feature": "Funzionalit\\%u00e0\\>", "given": "Dato\\>\\|Data\\>\\|Dati\\>\\|Date\\>", "scenario": "Scenario\\>", "scenario_outline": "Schema dello scenario\\>", "then": "Allora\\>", "when": "Quando\\>"}, +      \"ja": {"and": "\\%u304b\\%u3064", "background": "\\%u80cc\\%u666f\\>", "but": "\\%u3057\\%u304b\\%u3057\\|\\%u305f\\%u3060\\%u3057\\|\\%u4f46\\%u3057", "examples": "\\%u30b5\\%u30f3\\%u30d7\\%u30eb\\>\\|\\%u4f8b\\>", "feature": "\\%u30d5\\%u30a3\\%u30fc\\%u30c1\\%u30e3\\>\\|\\%u6a5f\\%u80fd\\>", "given": "\\%u524d\\%u63d0", "scenario": "\\%u30b7\\%u30ca\\%u30ea\\%u30aa\\>", "scenario_outline": "\\%u30b7\\%u30ca\\%u30ea\\%u30aa\\%u30a2\\%u30a6\\%u30c8\\%u30e9\\%u30a4\\%u30f3\\>\\|\\%u30b7\\%u30ca\\%u30ea\\%u30aa\\%u30c6\\%u30f3\\%u30d7\\%u30ec\\%u30fc\\%u30c8\\>\\|\\%u30b7\\%u30ca\\%u30ea\\%u30aa\\%u30c6\\%u30f3\\%u30d7\\%u30ec\\>\\|\\%u30c6\\%u30f3\\%u30d7\\%u30ec\\>", "then": "\\%u306a\\%u3089\\%u3070", "when": "\\%u3082\\%u3057"}, +      \"ko": {"and": "\\%uadf8\\%ub9ac\\%uace0", "background": "\\%ubc30\\%uacbd\\>", "but": "\\%ud558\\%uc9c0\\%ub9cc\\|\\%ub2e8", "examples": "\\%uc608\\>", "feature": "\\%uae30\\%ub2a5\\>", "given": "\\%uc870\\%uac74\\|\\%uba3c\\%uc800", "scenario": "\\%uc2dc\\%ub098\\%ub9ac\\%uc624\\>", "scenario_outline": "\\%uc2dc\\%ub098\\%ub9ac\\%uc624 \\%uac1c\\%uc694\\>", "then": "\\%uadf8\\%ub7ec\\%uba74", "when": "\\%ub9cc\\%uc77c\\|\\%ub9cc\\%uc57d"}, +      \"lt": {"and": "Ir\\>", "background": "Kontekstas\\>", "but": "Bet\\>", "examples": "Pavyzd\\%u017eiai\\>\\|Scenarijai\\>\\|Variantai\\>", "feature": "Savyb\\%u0117\\>", "given": "Duota\\>", "scenario": "Scenarijus\\>", "scenario_outline": "Scenarijaus \\%u0161ablonas\\>", "then": "Tada\\>", "when": "Kai\\>"}, +      \"lu": {"and": "an\\>\\|a\\>", "background": "Hannergrond\\>", "but": "m\\%u00e4\\>\\|awer\\>", "examples": "Beispiller\\>", "feature": "Funktionalit\\%u00e9it\\>", "given": "ugeholl\\>", "scenario": "Szenario\\>", "scenario_outline": "Plang vum Szenario\\>", "then": "dann\\>", "when": "wann\\>"}, +      \"lv": {"and": "Un\\>", "background": "Situ\\%u0101cija\\>\\|Konteksts\\>", "but": "Bet\\>", "examples": "Piem\\%u0113ri\\>\\|Paraugs\\>", "feature": "Funkcionalit\\%u0101te\\>\\|F\\%u012b\\%u010da\\>", "given": "Kad\\>", "scenario": "Scen\\%u0101rijs\\>", "scenario_outline": "Scen\\%u0101rijs p\\%u0113c parauga\\>", "then": "Tad\\>", "when": "Ja\\>"}, +      \"nl": {"and": "En\\>", "background": "Achtergrond\\>", "but": "Maar\\>", "examples": "Voorbeelden\\>", "feature": "Functionaliteit\\>", "given": "Gegeven\\>\\|Stel\\>", "scenario": "Scenario\\>", "scenario_outline": "Abstract Scenario\\>", "then": "Dan\\>", "when": "Als\\>"}, +      \"no": {"and": "Og\\>", "background": "Bakgrunn\\>", "but": "Men\\>", "examples": "Eksempler\\>", "feature": "Egenskap\\>", "given": "Gitt\\>", "scenario": "Scenario\\>", "scenario_outline": "Abstrakt Scenario\\>\\|Scenariomal\\>", "then": "S\\%u00e5\\>", "when": "N\\%u00e5r\\>"}, +      \"pl": {"and": "Oraz\\>\\|I\\>", "background": "Za\\%u0142o\\%u017cenia\\>", "but": "Ale\\>", "examples": "Przyk\\%u0142ady\\>", "feature": "W\\%u0142a\\%u015bciwo\\%u015b\\%u0107\\>\\|Potrzeba biznesowa\\>\\|Funkcja\\>\\|Aspekt\\>", "given": "Zak\\%u0142adaj\\%u0105c\\>\\|Maj\\%u0105c\\>", "scenario": "Scenariusz\\>", "scenario_outline": "Szablon scenariusza\\>", "then": "Wtedy\\>", "when": "Je\\%u017celi\\>\\|Je\\%u015bli\\>\\|Kiedy\\>\\|Gdy\\>"}, +      \"pt": {"and": "E\\>", "background": "Cen\\%u00e1rio de Fundo\\>\\|Cenario de Fundo\\>\\|Contexto\\>\\|Fundo\\>", "but": "Mas\\>", "examples": "Cen\\%u00e1rios\\>\\|Exemplos\\>\\|Cenarios\\>", "feature": "Caracter\\%u00edstica\\>\\|Funcionalidade\\>\\|Caracteristica\\>", "given": "Dadas\\>\\|Dados\\>\\|Dada\\>\\|Dado\\>", "scenario": "Cen\\%u00e1rio\\>\\|Cenario\\>", "scenario_outline": "Delinea\\%u00e7\\%u00e3o do Cen\\%u00e1rio\\>\\|Esquema do Cen\\%u00e1rio\\>\\|Delineacao do Cenario\\>\\|Esquema do Cenario\\>", "then": "Ent\\%u00e3o\\>\\|Entao\\>", "when": "Quando\\>"}, +      \"ro": {"and": "\\%u015ei\\>\\|\\%u0218i\\>\\|Si\\>", "background": "Context\\>", "but": "Dar\\>", "examples": "Exemple\\>", "feature": "Func\\%u0163ionalitate\\>\\|Func\\%u021bionalitate\\>\\|Functionalitate\\>", "given": "Da\\%u0163i fiind\\>\\|Da\\%u021bi fiind\\>\\|Dati fiind\\>\\|Date fiind\\>\\|Dat fiind\\>", "scenario": "Scenariu\\>", "scenario_outline": "Structur\\%u0103 scenariu\\>\\|Structura scenariu\\>", "then": "Atunci\\>", "when": "C\\%u00e2nd\\>\\|Cand\\>"}, +      \"ru": {"and": "\\%u041a \\%u0442\\%u043e\\%u043c\\%u0443 \\%u0436\\%u0435\\>\\|\\%u0422\\%u0430\\%u043a\\%u0436\\%u0435\\>\\|\\%u0418\\>", "background": "\\%u041f\\%u0440\\%u0435\\%u0434\\%u044b\\%u0441\\%u0442\\%u043e\\%u0440\\%u0438\\%u044f\\>\\|\\%u041a\\%u043e\\%u043d\\%u0442\\%u0435\\%u043a\\%u0441\\%u0442\\>", "but": "\\%u041d\\%u043e\\>\\|\\%u0410\\>", "examples": "\\%u041f\\%u0440\\%u0438\\%u043c\\%u0435\\%u0440\\%u044b\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0438\\%u043e\\%u043d\\%u0430\\%u043b\\>\\|\\%u0421\\%u0432\\%u043e\\%u0439\\%u0441\\%u0442\\%u0432\\%u043e\\>\\|\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0438\\%u044f\\>", "given": "\\%u0414\\%u043e\\%u043f\\%u0443\\%u0441\\%u0442\\%u0438\\%u043c\\>\\|\\%u041f\\%u0443\\%u0441\\%u0442\\%u044c\\>\\|\\%u0414\\%u0430\\%u043d\\%u043e\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\>", "scenario_outline": "\\%u0421\\%u0442\\%u0440\\%u0443\\%u043a\\%u0442\\%u0443\\%u0440\\%u0430 \\%u0441\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u044f\\>", "then": "\\%u0422\\%u043e\\%u0433\\%u0434\\%u0430\\>\\|\\%u0422\\%u043e\\>", "when": "\\%u041a\\%u043e\\%u0433\\%u0434\\%u0430\\>\\|\\%u0415\\%u0441\\%u043b\\%u0438\\>"}, +      \"sk": {"and": "A z\\%u00e1rove\\%u0148\\>\\|A taktie\\%u017e\\>\\|A tie\\%u017e\\>\\|A\\>", "background": "Pozadie\\>", "but": "Ale\\>", "examples": "Pr\\%u00edklady\\>", "feature": "Po\\%u017eiadavka\\>\\|Vlastnos\\%u0165\\>\\|Funkcia\\>", "given": "Za predpokladu\\>\\|Pokia\\%u013e\\>", "scenario": "Scen\\%u00e1r\\>", "scenario_outline": "N\\%u00e1\\%u010drt Scen\\%u00e1ru\\>\\|N\\%u00e1\\%u010drt Scen\\%u00e1ra\\>\\|Osnova Scen\\%u00e1ra\\>", "then": "Potom\\>\\|Tak\\>", "when": "Ke\\%u010f\\>\\|Ak\\>"}, +      \"sr-Cyrl": {"and": "\\%u0418\\>", "background": "\\%u041a\\%u043e\\%u043d\\%u0442\\%u0435\\%u043a\\%u0441\\%u0442\\>\\|\\%u041f\\%u043e\\%u0437\\%u0430\\%u0434\\%u0438\\%u043d\\%u0430\\>\\|\\%u041e\\%u0441\\%u043d\\%u043e\\%u0432\\%u0430\\>", "but": "\\%u0410\\%u043b\\%u0438\\>", "examples": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0458\\%u0438\\>\\|\\%u041f\\%u0440\\%u0438\\%u043c\\%u0435\\%u0440\\%u0438\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0438\\%u043e\\%u043d\\%u0430\\%u043b\\%u043d\\%u043e\\%u0441\\%u0442\\>\\|\\%u041c\\%u043e\\%u0433\\%u0443\\%u045b\\%u043d\\%u043e\\%u0441\\%u0442\\>\\|\\%u041e\\%u0441\\%u043e\\%u0431\\%u0438\\%u043d\\%u0430\\>", "given": "\\%u0417\\%u0430\\%u0434\\%u0430\\%u0442\\%u043e\\>\\|\\%u0417\\%u0430\\%u0434\\%u0430\\%u0442\\%u0435\\>\\|\\%u0417\\%u0430\\%u0434\\%u0430\\%u0442\\%u0438\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u043e\\>\\|\\%u041f\\%u0440\\%u0438\\%u043c\\%u0435\\%u0440\\>", "scenario_outline": "\\%u0421\\%u0442\\%u0440\\%u0443\\%u043a\\%u0442\\%u0443\\%u0440\\%u0430 \\%u0441\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0458\\%u0430\\>\\|\\%u041a\\%u043e\\%u043d\\%u0446\\%u0435\\%u043f\\%u0442\\>\\|\\%u0421\\%u043a\\%u0438\\%u0446\\%u0430\\>", "then": "\\%u041e\\%u043d\\%u0434\\%u0430\\>", "when": "\\%u041a\\%u0430\\%u0434\\%u0430\\>\\|\\%u041a\\%u0430\\%u0434\\>"}, +      \"sr-Latn": {"and": "I\\>", "background": "Kontekst\\>\\|Pozadina\\>\\|Osnova\\>", "but": "Ali\\>", "examples": "Scenariji\\>\\|Primeri\\>", "feature": "Mogu\\%u0107nost\\>\\|Funkcionalnost\\>\\|Mogucnost\\>\\|Osobina\\>", "given": "Zadato\\>\\|Zadate\\>\\|Zatati\\>", "scenario": "Scenario\\>\\|Primer\\>", "scenario_outline": "Struktura scenarija\\>\\|Koncept\\>\\|Skica\\>", "then": "Onda\\>", "when": "Kada\\>\\|Kad\\>"}, +      \"sv": {"and": "Och\\>", "background": "Bakgrund\\>", "but": "Men\\>", "examples": "Exempel\\>", "feature": "Egenskap\\>", "given": "Givet\\>", "scenario": "Scenario\\>", "scenario_outline": "Abstrakt Scenario\\>\\|Scenariomall\\>", "then": "S\\%u00e5\\>", "when": "N\\%u00e4r\\>"}, +      \"th": {"and": "\\%u0e41\\%u0e25\\%u0e30\\>", "background": "\\%u0e41\\%u0e19\\%u0e27\\%u0e04\\%u0e34\\%u0e14\\>", "but": "\\%u0e41\\%u0e15\\%u0e48\\>", "examples": "\\%u0e0a\\%u0e38\\%u0e14\\%u0e02\\%u0e2d\\%u0e07\\%u0e40\\%u0e2b\\%u0e15\\%u0e38\\%u0e01\\%u0e32\\%u0e23\\%u0e13\\%u0e4c\\>\\|\\%u0e0a\\%u0e38\\%u0e14\\%u0e02\\%u0e2d\\%u0e07\\%u0e15\\%u0e31\\%u0e27\\%u0e2d\\%u0e22\\%u0e48\\%u0e32\\%u0e07\\>", "feature": "\\%u0e04\\%u0e27\\%u0e32\\%u0e21\\%u0e15\\%u0e49\\%u0e2d\\%u0e07\\%u0e01\\%u0e32\\%u0e23\\%u0e17\\%u0e32\\%u0e07\\%u0e18\\%u0e38\\%u0e23\\%u0e01\\%u0e34\\%u0e08\\>\\|\\%u0e04\\%u0e27\\%u0e32\\%u0e21\\%u0e2a\\%u0e32\\%u0e21\\%u0e32\\%u0e23\\%u0e16\\>\\|\\%u0e42\\%u0e04\\%u0e23\\%u0e07\\%u0e2b\\%u0e25\\%u0e31\\%u0e01\\>", "given": "\\%u0e01\\%u0e33\\%u0e2b\\%u0e19\\%u0e14\\%u0e43\\%u0e2b\\%u0e49\\>", "scenario": "\\%u0e40\\%u0e2b\\%u0e15\\%u0e38\\%u0e01\\%u0e32\\%u0e23\\%u0e13\\%u0e4c\\>", "scenario_outline": "\\%u0e42\\%u0e04\\%u0e23\\%u0e07\\%u0e2a\\%u0e23\\%u0e49\\%u0e32\\%u0e07\\%u0e02\\%u0e2d\\%u0e07\\%u0e40\\%u0e2b\\%u0e15\\%u0e38\\%u0e01\\%u0e32\\%u0e23\\%u0e13\\%u0e4c\\>\\|\\%u0e2a\\%u0e23\\%u0e38\\%u0e1b\\%u0e40\\%u0e2b\\%u0e15\\%u0e38\\%u0e01\\%u0e32\\%u0e23\\%u0e13\\%u0e4c\\>", "then": "\\%u0e14\\%u0e31\\%u0e07\\%u0e19\\%u0e31\\%u0e49\\%u0e19\\>", "when": "\\%u0e40\\%u0e21\\%u0e37\\%u0e48\\%u0e2d\\>"}, +      \"tl": {"and": "\\%u0c2e\\%u0c30\\%u0c3f\\%u0c2f\\%u0c41\\>", "background": "\\%u0c28\\%u0c47\\%u0c2a\\%u0c25\\%u0c4d\\%u0c2f\\%u0c02\\>", "but": "\\%u0c15\\%u0c3e\\%u0c28\\%u0c3f\\>", "examples": "\\%u0c09\\%u0c26\\%u0c3e\\%u0c39\\%u0c30\\%u0c23\\%u0c32\\%u0c41\\>", "feature": "\\%u0c17\\%u0c41\\%u0c23\\%u0c2e\\%u0c41\\>", "given": "\\%u0c1a\\%u0c46\\%u0c2a\\%u0c4d\\%u0c2a\\%u0c2c\\%u0c21\\%u0c3f\\%u0c28\\%u0c26\\%u0c3f\\>", "scenario": "\\%u0c38\\%u0c28\\%u0c4d\\%u0c28\\%u0c3f\\%u0c35\\%u0c47\\%u0c36\\%u0c02\\>", "scenario_outline": "\\%u0c15\\%u0c25\\%u0c28\\%u0c02\\>", "then": "\\%u0c05\\%u0c2a\\%u0c4d\\%u0c2a\\%u0c41\\%u0c21\\%u0c41\\>", "when": "\\%u0c08 \\%u0c2a\\%u0c30\\%u0c3f\\%u0c38\\%u0c4d\\%u0c25\\%u0c3f\\%u0c24\\%u0c3f\\%u0c32\\%u0c4b\\>"}, +      \"tr": {"and": "Ve\\>", "background": "Ge\\%u00e7mi\\%u015f\\>", "but": "Fakat\\>\\|Ama\\>", "examples": "\\%u00d6rnekler\\>", "feature": "\\%u00d6zellik\\>", "given": "Diyelim ki\\>", "scenario": "Senaryo\\>", "scenario_outline": "Senaryo tasla\\%u011f\\%u0131\\>", "then": "O zaman\\>", "when": "E\\%u011fer ki\\>"}, +      \"tt": {"and": "\\%u04ba\\%u04d9\\%u043c\\>\\|\\%u0412\\%u04d9\\>", "background": "\\%u041a\\%u0435\\%u0440\\%u0435\\%u0448\\>", "but": "\\%u041b\\%u04d9\\%u043a\\%u0438\\%u043d\\>\\|\\%u04d8\\%u043c\\%u043c\\%u0430\\>", "examples": "\\%u04ae\\%u0440\\%u043d\\%u04d9\\%u043a\\%u043b\\%u04d9\\%u0440\\>\\|\\%u041c\\%u0438\\%u0441\\%u0430\\%u043b\\%u043b\\%u0430\\%u0440\\>", "feature": "\\%u04ae\\%u0437\\%u0435\\%u043d\\%u0447\\%u04d9\\%u043b\\%u0435\\%u043a\\%u043b\\%u0435\\%u043b\\%u0435\\%u043a\\>\\|\\%u041c\\%u04e9\\%u043c\\%u043a\\%u0438\\%u043d\\%u043b\\%u0435\\%u043a\\>", "given": "\\%u04d8\\%u0439\\%u0442\\%u0438\\%u043a\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\>", "scenario_outline": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\%u043d\\%u044b\\%u04a3 \\%u0442\\%u04e9\\%u0437\\%u0435\\%u043b\\%u0435\\%u0448\\%u0435\\>", "then": "\\%u041d\\%u04d9\\%u0442\\%u0438\\%u0497\\%u04d9\\%u0434\\%u04d9\\>", "when": "\\%u04d8\\%u0433\\%u04d9\\%u0440\\>"}, +      \"uk": {"and": "\\%u0410 \\%u0442\\%u0430\\%u043a\\%u043e\\%u0436\\>\\|\\%u0422\\%u0430\\>\\|\\%u0406\\>", "background": "\\%u041f\\%u0435\\%u0440\\%u0435\\%u0434\\%u0443\\%u043c\\%u043e\\%u0432\\%u0430\\>", "but": "\\%u0410\\%u043b\\%u0435\\>", "examples": "\\%u041f\\%u0440\\%u0438\\%u043a\\%u043b\\%u0430\\%u0434\\%u0438\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0456\\%u043e\\%u043d\\%u0430\\%u043b\\>", "given": "\\%u041f\\%u0440\\%u0438\\%u043f\\%u0443\\%u0441\\%u0442\\%u0438\\%u043c\\%u043e, \\%u0449\\%u043e\\>\\|\\%u041f\\%u0440\\%u0438\\%u043f\\%u0443\\%u0441\\%u0442\\%u0438\\%u043c\\%u043e\\>\\|\\%u041d\\%u0435\\%u0445\\%u0430\\%u0439\\>\\|\\%u0414\\%u0430\\%u043d\\%u043e\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0456\\%u0439\\>", "scenario_outline": "\\%u0421\\%u0442\\%u0440\\%u0443\\%u043a\\%u0442\\%u0443\\%u0440\\%u0430 \\%u0441\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0456\\%u044e\\>", "then": "\\%u0422\\%u043e\\%u0434\\%u0456\\>\\|\\%u0422\\%u043e\\>", "when": "\\%u042f\\%u043a\\%u0449\\%u043e\\>\\|\\%u041a\\%u043e\\%u043b\\%u0438\\>"}, +      \"uz": {"and": "\\%u0412\\%u0430\\>", "background": "\\%u0422\\%u0430\\%u0440\\%u0438\\%u0445\\>", "but": "\\%u041b\\%u0435\\%u043a\\%u0438\\%u043d\\>\\|\\%u0411\\%u0438\\%u0440\\%u043e\\%u043a\\>\\|\\%u0410\\%u043c\\%u043c\\%u043e\\>", "examples": "\\%u041c\\%u0438\\%u0441\\%u043e\\%u043b\\%u043b\\%u0430\\%u0440\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0438\\%u043e\\%u043d\\%u0430\\%u043b\\>", "given": "\\%u0410\\%u0433\\%u0430\\%u0440\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\>", "scenario_outline": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439 \\%u0441\\%u0442\\%u0440\\%u0443\\%u043a\\%u0442\\%u0443\\%u0440\\%u0430\\%u0441\\%u0438\\>", "then": "\\%u0423\\%u043d\\%u0434\\%u0430\\>", "when": "\\%u0410\\%u0433\\%u0430\\%u0440\\>"}, +      \"vi": {"and": "V\\%u00e0\\>", "background": "B\\%u1ed1i c\\%u1ea3nh\\>", "but": "Nh\\%u01b0ng\\>", "examples": "D\\%u1eef li\\%u1ec7u\\>", "feature": "T\\%u00ednh n\\%u0103ng\\>", "given": "Bi\\%u1ebft\\>\\|Cho\\>", "scenario": "T\\%u00ecnh hu\\%u1ed1ng\\>\\|K\\%u1ecbch b\\%u1ea3n\\>", "scenario_outline": "Khung t\\%u00ecnh hu\\%u1ed1ng\\>\\|Khung k\\%u1ecbch b\\%u1ea3n\\>", "then": "Th\\%u00ec\\>", "when": "Khi\\>"}, +      \"zh-CN": {"and": "\\%u800c\\%u4e14\\|\\%u5e76\\%u4e14\\|\\%u540c\\%u65f6", "background": "\\%u80cc\\%u666f\\>", "but": "\\%u4f46\\%u662f", "examples": "\\%u4f8b\\%u5b50\\>", "feature": "\\%u529f\\%u80fd\\>", "given": "\\%u5047\\%u5982\\|\\%u5047\\%u8bbe\\|\\%u5047\\%u5b9a", "scenario": "\\%u573a\\%u666f\\>\\|\\%u5267\\%u672c\\>", "scenario_outline": "\\%u573a\\%u666f\\%u5927\\%u7eb2\\>\\|\\%u5267\\%u672c\\%u5927\\%u7eb2\\>", "then": "\\%u90a3\\%u4e48", "when": "\\%u5f53"}, +      \"zh-TW": {"and": "\\%u800c\\%u4e14\\|\\%u4e26\\%u4e14\\|\\%u540c\\%u6642", "background": "\\%u80cc\\%u666f\\>", "but": "\\%u4f46\\%u662f", "examples": "\\%u4f8b\\%u5b50\\>", "feature": "\\%u529f\\%u80fd\\>", "given": "\\%u5047\\%u5982\\|\\%u5047\\%u8a2d\\|\\%u5047\\%u5b9a", "scenario": "\\%u5834\\%u666f\\>\\|\\%u5287\\%u672c\\>", "scenario_outline": "\\%u5834\\%u666f\\%u5927\\%u7db1\\>\\|\\%u5287\\%u672c\\%u5927\\%u7db1\\>", "then": "\\%u90a3\\%u9ebc", "when": "\\%u7576"}} + +function! s:pattern(key) +  let language = matchstr(getline(1),'#\s*language:\s*\zs\S\+') +  if &fileencoding == 'latin1' && language == '' +    let language = 'en' +  endif +  if has_key(g:cucumber_languages, language) +    let languages = [g:cucumber_languages[language]] +  else +    let languages = values(g:cucumber_languages) +  end +  return '\<\%('.join(map(languages,'get(v:val,a:key,"\\%(a\\&b\\)")'),'\|').'\)' +endfunction + +function! s:Add(name) +  let next = " skipempty skipwhite nextgroup=".join(map(["Region","AndRegion","ButRegion","Comment","String","Table"],'"cucumber".a:name.v:val'),",") +  exe "syn region cucumber".a:name.'Region matchgroup=cucumber'.a:name.' start="\%(^\s*\)\@<=\%('.s:pattern(tolower(a:name)).'\)" end="$"'.next +  exe 'syn region cucumber'.a:name.'AndRegion matchgroup=cucumber'.a:name.'And start="\%(^\s*\)\@<='.s:pattern('and').'" end="$" contained'.next +  exe 'syn region cucumber'.a:name.'ButRegion matchgroup=cucumber'.a:name.'But start="\%(^\s*\)\@<='.s:pattern('but').'" end="$" contained'.next +  exe 'syn match cucumber'.a:name.'Comment "\%(^\s*\)\@<=#.*" contained'.next +  exe 'syn region cucumber'.a:name.'String start=+\%(^\s*\)\@<="""+ end=+"""+ contained'.next +  exe 'syn match cucumber'.a:name.'Table "\%(^\s*\)\@<=|.*" contained contains=cucumberDelimiter'.next +  exe 'hi def link cucumber'.a:name.'Comment cucumberComment' +  exe 'hi def link cucumber'.a:name.'String cucumberString' +  exe 'hi def link cucumber'.a:name.'But cucumber'.a:name.'And' +  exe 'hi def link cucumber'.a:name.'And cucumber'.a:name +  exe 'syn cluster cucumberStepRegions add=cucumber'.a:name.'Region,cucumber'.a:name.'AndRegion,cucumber'.a:name.'ButRegion' +endfunction + +syn match   cucumberComment  "\%(^\s*\)\@<=#.*" +syn match   cucumberComment  "\%(\%^\s*\)\@<=#.*" contains=cucumberLanguage +syn match   cucumberLanguage "\%(#\s*\)\@<=language:" contained +syn match   cucumberUnparsed "\S.*" nextgroup=cucumberUnparsedComment,cucumberUnparsed,cucumberTags,cucumberBackground,cucumberScenario,cucumberScenarioOutline,cucumberExamples skipwhite skipempty contained +syn match   cucumberUnparsedComment "#.*" nextgroup=cucumberUnparsedComment,cucumberUnparsed,cucumberTags,cucumberBackground,cucumberScenario,cucumberScenarioOutline,cucumberExamples skipwhite skipempty contained + +exe 'syn match cucumberFeature "\%(^\s*\)\@<='.s:pattern('feature').':" nextgroup=cucumberUnparsedComment,cucumberUnparsed,cucumberBackground,cucumberScenario,cucumberScenarioOutline,cucumberExamples skipwhite skipempty' +exe 'syn match cucumberBackground "\%(^\s*\)\@<='.s:pattern('background').':"' +exe 'syn match cucumberScenario "\%(^\s*\)\@<='.s:pattern('scenario').':"' +exe 'syn match cucumberScenarioOutline "\%(^\s*\)\@<='.s:pattern('scenario_outline').':"' +exe 'syn match cucumberExamples "\%(^\s*\)\@<='.s:pattern('examples').':" nextgroup=cucumberExampleTable skipempty skipwhite' + +syn match   cucumberPlaceholder   "<[^<>]*>" contained containedin=@cucumberStepRegions +syn match   cucumberExampleTable  "\%(^\s*\)\@<=|.*" contains=cucumberDelimiter +syn match   cucumberDelimiter     "\\\@<!\%(\\\\\)*\zs|" contained +syn match   cucumberTags          "\%(^\s*\)\@<=\%(@[^@[:space:]]\+\s\+\)*@[^@[:space:]]\+\s*$" contains=@NoSpell + +call s:Add('Then') +call s:Add('When') +call s:Add('Given') + +hi def link cucumberUnparsedComment   cucumberComment +hi def link cucumberComment           Comment +hi def link cucumberLanguage          SpecialComment +hi def link cucumberFeature           Macro +hi def link cucumberBackground        Define +hi def link cucumberScenario          Define +hi def link cucumberScenarioOutline   Define +hi def link cucumberExamples          Define +hi def link cucumberPlaceholder       Constant +hi def link cucumberDelimiter         Delimiter +hi def link cucumberTags              Tag +hi def link cucumberString            String +hi def link cucumberGiven             Conditional +hi def link cucumberWhen              Function +hi def link cucumberThen              Type + +let b:current_syntax = "cucumber" + +" vim:set sts=2 sw=2: diff --git a/syntax/eruby.vim b/syntax/eruby.vim new file mode 100644 index 00000000..c20b086b --- /dev/null +++ b/syntax/eruby.vim @@ -0,0 +1,74 @@ +" Vim syntax file +" Language:		eRuby +" Maintainer:		Tim Pope <vimNOSPAM@tpope.org> +" URL:			https://github.com/vim-ruby/vim-ruby +" Release Coordinator:	Doug Kearns <dougkearns@gmail.com> + +if exists("b:current_syntax") +  finish +endif + +if !exists("main_syntax") +  let main_syntax = 'eruby' +endif + +if !exists("g:eruby_default_subtype") +  let g:eruby_default_subtype = "html" +endif + +if &filetype =~ '^eruby\.' +  let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+') +elseif !exists("b:eruby_subtype") && main_syntax == 'eruby' +  let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") +  let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') +  if b:eruby_subtype == '' +    let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$') +  endif +  if b:eruby_subtype == 'rhtml' +    let b:eruby_subtype = 'html' +  elseif b:eruby_subtype == 'rb' +    let b:eruby_subtype = 'ruby' +  elseif b:eruby_subtype == 'yml' +    let b:eruby_subtype = 'yaml' +  elseif b:eruby_subtype == 'js' +    let b:eruby_subtype = 'javascript' +  elseif b:eruby_subtype == 'txt' +    " Conventional; not a real file type +    let b:eruby_subtype = 'text' +  elseif b:eruby_subtype == '' +    let b:eruby_subtype = g:eruby_default_subtype +  endif +endif + +if !exists("b:eruby_nest_level") +  let b:eruby_nest_level = strlen(substitute(substitute(substitute(expand("%:t"),'@','','g'),'\c\.\%(erb\|rhtml\)\>','@','g'),'[^@]','','g')) +endif +if !b:eruby_nest_level +  let b:eruby_nest_level = 1 +endif + +if exists("b:eruby_subtype") && b:eruby_subtype != '' +  exe "runtime! syntax/".b:eruby_subtype.".vim" +  unlet! b:current_syntax +endif +syn include @rubyTop syntax/ruby.vim + +syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,erubyComment + +exe 'syn region  erubyOneLiner   matchgroup=erubyDelimiter start="^%\{1,'.b:eruby_nest_level.'\}%\@!"    end="$"     contains=@rubyTop	     containedin=ALLBUT,@erubyRegions keepend oneline' +exe 'syn region  erubyBlock      matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}%\@!-\=" end="[=-]\=%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=@rubyTop  containedin=ALLBUT,@erubyRegions keepend' +exe 'syn region  erubyExpression matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}=\{1,4}" end="[=-]\=%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=@rubyTop  containedin=ALLBUT,@erubyRegions keepend' +exe 'syn region  erubyComment    matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}-\=#"    end="[=-]\=%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=rubyTodo,@Spell containedin=ALLBUT,@erubyRegions keepend' + +" Define the default highlighting. + +hi def link erubyDelimiter		PreProc +hi def link erubyComment		Comment + +let b:current_syntax = 'eruby' + +if main_syntax == 'eruby' +  unlet main_syntax +endif + +" vim: nowrap sw=2 sts=2 ts=8: diff --git a/syntax/haml.vim b/syntax/haml.vim new file mode 100644 index 00000000..bf7a0736 --- /dev/null +++ b/syntax/haml.vim @@ -0,0 +1,109 @@ +" Vim syntax file +" Language:	Haml +" Maintainer:	Tim Pope <vimNOSPAM@tpope.org> +" Filenames:	*.haml +" Last Change:	2010 Aug 09 + +if exists("b:current_syntax") +  finish +endif + +if !exists("main_syntax") +  let main_syntax = 'haml' +endif +let b:ruby_no_expensive = 1 + +runtime! syntax/html.vim +unlet! b:current_syntax +silent! syn include @hamlSassTop syntax/sass.vim +unlet! b:current_syntax +syn include @hamlRubyTop syntax/ruby.vim + +syn case match + +syn region  rubyCurlyBlock   start="{" end="}" contains=@hamlRubyTop contained +syn cluster hamlRubyTop add=rubyCurlyBlock + +syn cluster hamlComponent    contains=hamlAttributes,hamlAttributesHash,hamlClassChar,hamlIdChar,hamlObject,hamlDespacer,hamlSelfCloser,hamlRuby,hamlPlainChar,hamlInterpolatable +syn cluster hamlEmbeddedRuby contains=hamlAttributesHash,hamlObject,hamlRuby,hamlRubyFilter +syn cluster hamlTop          contains=hamlBegin,hamlPlainFilter,hamlRubyFilter,hamlSassFilter,hamlComment,hamlHtmlComment + +syn match   hamlBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=hamlTag,hamlClassChar,hamlIdChar,hamlRuby,hamlPlainChar,hamlInterpolatable + +syn match   hamlTag        "%\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@hamlComponent +syn region  hamlAttributes     matchgroup=hamlAttributesDelimiter start="(" end=")" contained contains=htmlArg,hamlAttributeString,hamlAttributeVariable,htmlEvent,htmlCssDefinition nextgroup=@hamlComponent +syn region  hamlAttributesHash matchgroup=hamlAttributesDelimiter start="{" end="}" contained contains=@hamlRubyTop nextgroup=@hamlComponent +syn region  hamlObject         matchgroup=hamlObjectDelimiter     start="\[" end="\]" contained contains=@hamlRubyTop nextgroup=@hamlComponent +syn match   hamlDespacer "[<>]" contained nextgroup=hamlDespacer,hamlSelfCloser,hamlRuby,hamlPlainChar,hamlInterpolatable +syn match   hamlSelfCloser "/" contained +syn match   hamlClassChar "\." contained nextgroup=hamlClass +syn match   hamlIdChar "#{\@!" contained nextgroup=hamlId +syn match   hamlClass "\%(\w\|-\)\+" contained nextgroup=@hamlComponent +syn match   hamlId    "\%(\w\|-\)\+" contained nextgroup=@hamlComponent +syn region  hamlDocType start="^\s*!!!" end="$" + +syn region  hamlRuby   matchgroup=hamlRubyOutputChar start="[!&]\==\|\~" skip=",\s*$" end="$" contained contains=@hamlRubyTop keepend +syn region  hamlRuby   matchgroup=hamlRubyChar       start="-"           skip=",\s*$" end="$" contained contains=@hamlRubyTop keepend +syn match   hamlPlainChar "\\" contained +syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="!\===\|!=\@!" end="$" keepend contained contains=hamlInterpolation,hamlInterpolationEscape,@hamlHtmlTop +syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="&==\|&=\@!"   end="$" keepend contained contains=hamlInterpolation,hamlInterpolationEscape +syn region hamlInterpolation matchgroup=hamlInterpolationDelimiter start="#{" end="}" contains=@hamlRubyTop containedin=javascriptStringS,javascriptStringD +syn match  hamlInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)" +syn region hamlErbInterpolation matchgroup=hamlInterpolationDelimiter start="<%[=-]\=" end="-\=%>" contained contains=@hamlRubyTop + +syn region  hamlAttributeString start=+\%(=\s*\)\@<='+ skip=+\%(\\\\\)*\\'+ end=+'+ contains=hamlInterpolation,hamlInterpolationEscape +syn region  hamlAttributeString start=+\%(=\s*\)\@<="+ skip=+\%(\\\\\)*\\"+ end=+"+ contains=hamlInterpolation,hamlInterpolationEscape +syn match   hamlAttributeVariable "\%(=\s*\)\@<=\%(@@\=\|\$\)\=\w\+" contained + +syn match   hamlHelper  "\<action_view?\|\<block_is_haml?\|\<is_haml?\|\.\@<!\<flatten" contained containedin=@hamlEmbeddedRuby,@hamlRubyTop +syn keyword hamlHelper   capture_haml escape_once find_and_preserve haml_concat haml_indent haml_tag html_attrs html_esape init_haml_helpers list_of non_haml precede preserve succeed surround tab_down tab_up page_class contained containedin=@hamlEmbeddedRuby,@hamlRubyTop + +syn cluster hamlHtmlTop contains=@htmlTop,htmlBold,htmlItalic,htmlUnderline +syn region  hamlPlainFilter      matchgroup=hamlFilter start="^\z(\s*\):\%(plain\|preserve\|redcloth\|textile\|markdown\|maruku\)\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlHtmlTop,hamlInterpolation +syn region  hamlEscapedFilter    matchgroup=hamlFilter start="^\z(\s*\):\%(escaped\|cdata\)\s*$"    end="^\%(\z1 \| *$\)\@!" contains=hamlInterpolation +syn region  hamlErbFilter        matchgroup=hamlFilter start="^\z(\s*\):erb\s*$"        end="^\%(\z1 \| *$\)\@!" contains=@hamlHtmlTop,hamlErbInterpolation +syn region  hamlRubyFilter       matchgroup=hamlFilter start="^\z(\s*\):ruby\s*$"       end="^\%(\z1 \| *$\)\@!" contains=@hamlRubyTop +syn region  hamlJavascriptFilter matchgroup=hamlFilter start="^\z(\s*\):javascript\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlJavaScript,hamlInterpolation keepend +syn region  hamlCSSFilter        matchgroup=hamlFilter start="^\z(\s*\):css\s*$"        end="^\%(\z1 \| *$\)\@!" contains=@htmlCss,hamlInterpolation keepend +syn region  hamlSassFilter       matchgroup=hamlFilter start="^\z(\s*\):sass\s*$"       end="^\%(\z1 \| *$\)\@!" contains=@hamlSassTop + +syn region  hamlJavascriptBlock start="^\z(\s*\)%script" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlJavaScript keepend +syn region  hamlCssBlock        start="^\z(\s*\)%style" nextgroup=@hamlComponent,hamlError  end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlCss keepend +syn match   hamlError "\$" contained + +syn region  hamlComment     start="^\z(\s*\)-#" end="^\%(\z1 \| *$\)\@!" contains=rubyTodo +syn region  hamlHtmlComment start="^\z(\s*\)/"  end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,rubyTodo +syn match   hamlIEConditional "\%(^\s*/\)\@<=\[if\>[^]]*]" contained containedin=hamlHtmlComment + +hi def link hamlSelfCloser             Special +hi def link hamlDespacer               Special +hi def link hamlClassChar              Special +hi def link hamlIdChar                 Special +hi def link hamlTag                    Special +hi def link hamlClass                  Type +hi def link hamlId                     Identifier +hi def link hamlPlainChar              Special +hi def link hamlInterpolatableChar     hamlRubyChar +hi def link hamlRubyOutputChar         hamlRubyChar +hi def link hamlRubyChar               Special +hi def link hamlInterpolationDelimiter Delimiter +hi def link hamlInterpolationEscape    Special +hi def link hamlAttributeString        String +hi def link hamlAttributeVariable      Identifier +hi def link hamlDocType                PreProc +hi def link hamlFilter                 PreProc +hi def link hamlAttributesDelimiter    Delimiter +hi def link hamlObjectDelimiter        Delimiter +hi def link hamlHelper                 Function +hi def link hamlHtmlComment            hamlComment +hi def link hamlComment                Comment +hi def link hamlIEConditional          SpecialComment +hi def link hamlError                  Error + +let b:current_syntax = "haml" + +if main_syntax == "haml" +  unlet main_syntax +endif + +" vim:set sw=2: diff --git a/syntax/haskell.vim b/syntax/haskell.vim new file mode 100644 index 00000000..7ac0fe26 --- /dev/null +++ b/syntax/haskell.vim @@ -0,0 +1,359 @@ +" Vim syntax file +" +" Modification of vims Haskell syntax file: +"   - match types using regular expression +"   - highlight toplevel functions +"   - use "syntax keyword" instead of "syntax match" where appropriate +"   - functions and types in import and module declarations are matched +"   - removed hs_highlight_more_types (just not needed anymore) +"   - enable spell checking in comments and strings only +"   - FFI highlighting +"   - QuasiQuotation +"   - top level Template Haskell slices +"   - PackageImport +" +" TODO: find out which vim versions are still supported +" +" From Original file: +" =================== +" +" Language:		    Haskell +" Maintainer:		Haskell Cafe mailinglist <haskell-cafe@haskell.org> +" Last Change:		2010 Feb 21 +" Original Author:	John Williams <jrw@pobox.com> +" +" Thanks to Ryan Crumley for suggestions and John Meacham for +" pointing out bugs. Also thanks to Ian Lynagh and Donald Bruce Stewart +" for providing the inspiration for the inclusion of the handling +" of C preprocessor directives, and for pointing out a bug in the +" end-of-line comment handling. +" +" Options-assign a value to these variables to turn the option on: +" +" hs_highlight_delimiters - Highlight delimiter characters--users +"			    with a light-colored background will +"			    probably want to turn this on. +" hs_highlight_boolean - Treat True and False as keywords. +" hs_highlight_types - Treat names of primitive types as keywords. +" hs_highlight_debug - Highlight names of debugging functions. +" hs_allow_hash_operator - Don't highlight seemingly incorrect C +"			   preprocessor directives but assume them to be +"			   operators +"  +"  + +if version < 600 +  syn clear +elseif exists("b:current_syntax") +  finish +endif + +"syntax sync fromstart "mmhhhh.... is this really ok to do so? +syntax sync linebreaks=15 minlines=50 maxlines=500 + +syn match  hsSpecialChar	contained "\\\([0-9]\+\|o[0-7]\+\|x[0-9a-fA-F]\+\|[\"\\'&\\abfnrtv]\|^[A-Z^_\[\\\]]\)" +syn match  hsSpecialChar	contained "\\\(NUL\|SOH\|STX\|ETX\|EOT\|ENQ\|ACK\|BEL\|BS\|HT\|LF\|VT\|FF\|CR\|SO\|SI\|DLE\|DC1\|DC2\|DC3\|DC4\|NAK\|SYN\|ETB\|CAN\|EM\|SUB\|ESC\|FS\|GS\|RS\|US\|SP\|DEL\)" +syn match  hsSpecialCharError	contained "\\&\|'''\+" +sy region  hsString		start=+"+  skip=+\\\\\|\\"+  end=+"+  contains=hsSpecialChar,@Spell +sy match   hsCharacter		"[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=hsSpecialChar,hsSpecialCharError +sy match   hsCharacter		"^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hsSpecialCharError + +" (Qualified) identifiers (no default highlighting) +syn match ConId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[A-Z][a-zA-Z0-9_']*\>" +syn match VarId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[a-z][a-zA-Z0-9_']*\>" + +" Infix operators--most punctuation characters and any (qualified) identifier +" enclosed in `backquotes`. An operator starting with : is a constructor, +" others are variables (e.g. functions). +syn match hsVarSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[-!#$%&\*\+/<=>\?@\\^|~.][-!#$%&\*\+/<=>\?@\\^|~:.]*" +syn match hsConSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=:[-!#$%&\*\+./<=>\?@\\^|~:]*" +syn match hsVarSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[a-z][a-zA-Z0-9_']*`" +syn match hsConSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[A-Z][a-zA-Z0-9_']*`" + +" Toplevel Template Haskell support +"sy match hsTHTopLevel "^[a-z]\(\(.\&[^=]\)\|\(\n[^a-zA-Z0-9]\)\)*" +sy match hsTHIDTopLevel "^[a-z]\S*"  +sy match hsTHTopLevel "^\$(\?" nextgroup=hsTHTopLevelName  +sy match hsTHTopLevelName "[a-z]\S*" contained + +" Reserved symbols--cannot be overloaded. +syn match hsDelimiter  "(\|)\|\[\|\]\|,\|;\|_\|{\|}" + +sy region hsInnerParen start="(" end=")" contained contains=hsInnerParen,hsConSym,hsType,hsVarSym +sy region hs_InfixOpFunctionName start="^(" end=")\s*[^:`]\(\W\&\S\&[^'\"`()[\]{}@]\)\+"re=s +    \ contained keepend contains=hsInnerParen,hs_HlInfixOp + +sy match hs_hlFunctionName "[a-z_]\(\S\&[^,\(\)\[\]]\)*" contained  +sy match hs_FunctionName "^[a-z_]\(\S\&[^,\(\)\[\]]\)*" contained contains=hs_hlFunctionName +sy match hs_HighliteInfixFunctionName "`[a-z_][^`]*`" contained +sy match hs_InfixFunctionName "^\S[^=]*`[a-z_][^`]*`"me=e-1 contained contains=hs_HighliteInfixFunctionName,hsType,hsConSym,hsVarSym,hsString,hsCharacter +sy match hs_HlInfixOp "\(\W\&\S\&[^`(){}'[\]]\)\+" contained contains=hsString +sy match hs_InfixOpFunctionName "^\(\(\w\|[[\]{}]\)\+\|\(\".*\"\)\|\('.*'\)\)\s*[^:]=*\(\W\&\S\&[^='\"`()[\]{}@]\)\+" +    \ contained contains=hs_HlInfixOp,hsCharacter + +sy match hs_OpFunctionName        "(\(\W\&[^(),\"]\)\+)" contained +"sy region hs_Function start="^["'a-z_([{]" end="=\(\s\|\n\|\w\|[([]\)" keepend extend +sy region hs_Function start="^["'a-zA-Z_([{]\(\(.\&[^=]\)\|\(\n\s\)\)*=" end="\(\s\|\n\|\w\|[([]\)"  +        \ contains=hs_OpFunctionName,hs_InfixOpFunctionName,hs_InfixFunctionName,hs_FunctionName,hsType,hsConSym,hsVarSym,hsString,hsCharacter + +sy match hs_TypeOp "::" +sy match hs_DeclareFunction "^[a-z_(]\S*\(\s\|\n\)*::" contains=hs_FunctionName,hs_OpFunctionName,hs_TypeOp + +" hi hs_TypeOp guibg=red + +" hi hs_InfixOpFunctionName guibg=yellow +" hi hs_Function guibg=green +" hi hs_InfixFunctionName guibg=red +" hi hs_DeclareFunction guibg=red + +sy keyword hsStructure data family class where instance default deriving +sy keyword hsTypedef type newtype + +sy keyword hsInfix infix infixl infixr +sy keyword hsStatement  do case of let in +sy keyword hsConditional if then else + +"if exists("hs_highlight_types") +  " Primitive types from the standard prelude and libraries. +  sy match hsType "\<[A-Z]\(\S\&[^,.]\)*\>" +  sy match hsType "()" +"endif + +" Not real keywords, but close. +if exists("hs_highlight_boolean") +  " Boolean constants from the standard prelude. +  syn keyword hsBoolean True False +endif + +syn region	hsPackageString	start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial contained +sy match   hsModuleName  excludenl "\([A-Z]\w*\.\?\)*" contained  + +sy match hsImport "\<import\>\s\+\(qualified\s\+\)\?\(\<\(\w\|\.\)*\>\)"  +    \ contains=hsModuleName,hsImportLabel +    \ nextgroup=hsImportParams,hsImportIllegal skipwhite +sy keyword hsImportLabel import qualified contained + +sy match hsImportIllegal "\w\+" contained + +sy keyword hsAsLabel as contained +sy keyword hsHidingLabel hiding contained + +sy match hsImportParams "as\s\+\(\w\+\)" contained +    \ contains=hsModuleName,hsAsLabel +    \ nextgroup=hsImportParams,hsImportIllegal skipwhite +sy match hsImportParams "hiding" contained +    \ contains=hsHidingLabel +    \ nextgroup=hsImportParams,hsImportIllegal skipwhite  +sy region hsImportParams start="(" end=")" contained +    \ contains=hsBlockComment,hsLineComment, hsType,hsDelimTypeExport,hs_hlFunctionName,hs_OpFunctionName +    \ nextgroup=hsImportIllegal skipwhite + +" hi hsImport guibg=red +"hi hsImportParams guibg=bg +"hi hsImportIllegal guibg=bg +"hi hsModuleName guibg=bg + +"sy match hsImport		"\<import\>\(.\|[^(]\)*\((.*)\)\?"  +"         \ contains=hsPackageString,hsImportLabel,hsImportMod,hsModuleName,hsImportList +"sy keyword hsImportLabel import contained +"sy keyword hsImportMod		as qualified hiding contained +"sy region hsImportListInner start="(" end=")" contained keepend extend contains=hs_OpFunctionName +"sy region  hsImportList matchgroup=hsImportListParens start="("rs=s+1 end=")"re=e-1 +"        \ contained  +"        \ keepend extend +"        \ contains=hsType,hsLineComment,hsBlockComment,hs_hlFunctionName,hsImportListInner + + + +" new module highlighting +syn region hsDelimTypeExport start="\<[A-Z]\(\S\&[^,.]\)*\>(" end=")" contained +   \ contains=hsType + +sy keyword hsExportModuleLabel module contained +sy match hsExportModule "\<module\>\(\s\|\t\|\n\)*\([A-Z]\w*\.\?\)*" contained contains=hsExportModuleLabel,hsModuleName + +sy keyword hsModuleStartLabel module contained +sy keyword hsModuleWhereLabel where contained + +syn match hsModuleStart "^module\(\s\|\n\)*\(\<\(\w\|\.\)*\>\)\(\s\|\n\)*"  +  \ contains=hsModuleStartLabel,hsModuleName +  \ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel + +syn region hsModuleCommentA start="{-" end="-}" +  \ contains=hsModuleCommentA,hsCommentTodo,@Spell contained +  \ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel skipwhite skipnl + +syn match hsModuleCommentA "--.*\n" +  \ contains=hsCommentTodo,@Spell contained +  \ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel skipwhite skipnl + +syn region hsModuleExports start="(" end=")" contained +   \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl +   \ contains=hsBlockComment,hsLineComment,hsType,hsDelimTypeExport,hs_hlFunctionName,hs_OpFunctionName,hsExportModule + +syn match hsModuleCommentB "--.*\n" +  \ contains=hsCommentTodo,@Spell contained +  \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl + +syn region hsModuleCommentB start="{-" end="-}" +   \ contains=hsModuleCommentB,hsCommentTodo,@Spell contained +   \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl +" end module highlighting + +" FFI support +sy keyword hsFFIForeign foreign contained +"sy keyword hsFFIImportExport import export contained +sy keyword hsFFIImportExport export contained +sy keyword hsFFICallConvention ccall stdcall contained +sy keyword hsFFISafety safe unsafe contained +sy region  hsFFIString		start=+"+  skip=+\\\\\|\\"+  end=+"+  contained contains=hsSpecialChar +sy match hsFFI excludenl "\<foreign\>\(.\&[^\"]\)*\"\(.\)*\"\(\s\|\n\)*\(.\)*::" +  \ keepend +  \ contains=hsFFIForeign,hsFFIImportExport,hsFFICallConvention,hsFFISafety,hsFFIString,hs_OpFunctionName,hs_hlFunctionName + + +sy match   hsNumber		"\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>" +sy match   hsFloat		"\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>" + +" Comments +sy keyword hsCommentTodo    TODO FIXME XXX TBD contained +sy match   hsLineComment      "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=hsCommentTodo,@Spell +sy region  hsBlockComment     start="{-"  end="-}" contains=hsBlockComment,hsCommentTodo,@Spell +sy region  hsPragma	       start="{-#" end="#-}" + +" QuasiQuotation +sy region hsQQ start="\[\$" end="|\]"me=e-2 keepend contains=hsQQVarID,hsQQContent nextgroup=hsQQEnd +sy region hsQQNew start="\[\(.\&[^|]\&\S\)*|" end="|\]"me=e-2 keepend contains=hsQQVarIDNew,hsQQContent nextgroup=hsQQEnd +sy match hsQQContent ".*" contained +sy match hsQQEnd "|\]" contained +sy match hsQQVarID "\[\$\(.\&[^|]\)*|" contained +sy match hsQQVarIDNew "\[\(.\&[^|]\)*|" contained + +if exists("hs_highlight_debug") +  " Debugging functions from the standard prelude. +  syn keyword hsDebug undefined error trace +endif + + +" C Preprocessor directives. Shamelessly ripped from c.vim and trimmed +" First, see whether to flag directive-like lines or not +if (!exists("hs_allow_hash_operator")) +    syn match	cError		display "^\s*\(%:\|#\).*$" +endif +" Accept %: for # (C99) +syn region	cPreCondit	start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cComment,cCppString,cCommentError +syn match	cPreCondit	display "^\s*\(%:\|#\)\s*\(else\|endif\)\>" +syn region	cCppOut		start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2 +syn region	cCppOut2	contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cCppSkip +syn region	cCppSkip	contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cCppSkip +syn region	cIncluded	display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ +syn match	cIncluded	display contained "<[^>]*>" +syn match	cInclude	display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded +syn cluster	cPreProcGroup	contains=cPreCondit,cIncluded,cInclude,cDefine,cCppOut,cCppOut2,cCppSkip,cCommentStartError +syn region	cDefine		matchgroup=cPreCondit start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" +syn region	cPreProc	matchgroup=cPreCondit start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend + +syn region	cComment	matchgroup=cCommentStart start="/\*" end="\*/" contains=cCommentStartError,cSpaceError contained +syntax match	cCommentError	display "\*/" contained +syntax match	cCommentStartError display "/\*"me=e-1 contained +syn region	cCppString	start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial contained + + +if version >= 508 || !exists("did_hs_syntax_inits") +  if version < 508 +    let did_hs_syntax_inits = 1 +    command -nargs=+ HiLink hi link <args> +  else +    command -nargs=+ HiLink hi def link <args> +  endif + +  HiLink hs_hlFunctionName    Function +  HiLink hs_HighliteInfixFunctionName Function +  HiLink hs_HlInfixOp       Function +  HiLink hs_OpFunctionName  Function +  HiLink hsTypedef          Typedef +  HiLink hsVarSym           hsOperator +  HiLink hsConSym           hsOperator +  if exists("hs_highlight_delimiters") +    " Some people find this highlighting distracting. +	HiLink hsDelimiter        Delimiter +  endif + +  HiLink hsModuleStartLabel Structure +  HiLink hsExportModuleLabel Keyword +  HiLink hsModuleWhereLabel Structure +  HiLink hsModuleName       Normal +   +  HiLink hsImportIllegal    Error +  HiLink hsAsLabel          hsImportLabel +  HiLink hsHidingLabel      hsImportLabel +  HiLink hsImportLabel      Include +  HiLink hsImportMod        Include +  HiLink hsPackageString    hsString + +  HiLink hsOperator         Operator + +  HiLink hsInfix            Keyword +  HiLink hsStructure        Structure +  HiLink hsStatement        Statement +  HiLink hsConditional      Conditional + +  HiLink hsSpecialCharError Error +  HiLink hsSpecialChar      SpecialChar +  HiLink hsString           String +  HiLink hsFFIString        String +  HiLink hsCharacter        Character +  HiLink hsNumber           Number +  HiLink hsFloat            Float + +  HiLink hsLiterateComment		  hsComment +  HiLink hsBlockComment     hsComment +  HiLink hsLineComment      hsComment +  HiLink hsModuleCommentA   hsComment +  HiLink hsModuleCommentB   hsComment +  HiLink hsComment          Comment +  HiLink hsCommentTodo      Todo +  HiLink hsPragma           SpecialComment +  HiLink hsBoolean			  Boolean + +  if exists("hs_highlight_types") +      HiLink hsDelimTypeExport  hsType +      HiLink hsType             Type +  endif + +  HiLink hsDebug            Debug + +  HiLink hs_TypeOp          hsOperator + +  HiLink cCppString         hsString +  HiLink cCommentStart      hsComment +  HiLink cCommentError      hsError +  HiLink cCommentStartError hsError +  HiLink cInclude           Include +  HiLink cPreProc           PreProc +  HiLink cDefine            Macro +  HiLink cIncluded          hsString +  HiLink cError             Error +  HiLink cPreCondit         PreCondit +  HiLink cComment           Comment +  HiLink cCppSkip           cCppOut +  HiLink cCppOut2           cCppOut +  HiLink cCppOut            Comment + +  HiLink hsFFIForeign       Keyword +  HiLink hsFFIImportExport  Structure +  HiLink hsFFICallConvention Keyword +  HiLink hsFFISafety         Keyword + +  HiLink hsTHIDTopLevel   Macro +  HiLink hsTHTopLevelName Macro + +  HiLink hsQQVarID Keyword +  HiLink hsQQVarIDNew Keyword +  HiLink hsQQEnd   Keyword +  HiLink hsQQContent String + +  delcommand HiLink +endif + +let b:current_syntax = "haskell" diff --git a/syntax/javascript.vim b/syntax/javascript.vim new file mode 100644 index 00000000..e72c63a4 --- /dev/null +++ b/syntax/javascript.vim @@ -0,0 +1,312 @@ +" Vim syntax file +" Language:     JavaScript +" Maintainer:   vim-javascript community +" URL:          https://github.com/pangloss/vim-javascript + +if !exists("main_syntax") +  if version < 600 +    syntax clear +  elseif exists("b:current_syntax") +    finish +  endif +  let main_syntax = 'javascript' +endif + +if !exists('g:javascript_conceal') +  let g:javascript_conceal = 0 +endif + +"" Drop fold if it is set but VIM doesn't support it. +let b:javascript_fold='true' +if version < 600    " Don't support the old version +  unlet! b:javascript_fold +endif + +"" dollar sign is permittd anywhere in an identifier +setlocal iskeyword+=$ + +syntax sync fromstart + +syntax match   jsNoise           /\%(:\|,\|\;\|\.\)/ + +"" Program Keywords +syntax keyword jsStorageClass   const var let +syntax keyword jsOperator       delete instanceof typeof void new in +syntax match   jsOperator       /\(!\||\|&\|+\|-\|<\|>\|=\|%\|\/\|*\|\~\|\^\)/ +syntax keyword jsBooleanTrue    true +syntax keyword jsBooleanFalse   false + +"" JavaScript comments +syntax keyword jsCommentTodo    TODO FIXME XXX TBD contained +syntax region  jsLineComment    start=+\/\/+ end=+$+ keepend contains=jsCommentTodo,@Spell +syntax region  jsEnvComment     start="\%^#!" end="$" display +syntax region  jsLineComment    start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=jsCommentTodo,@Spell fold +syntax region  jsCvsTag         start="\$\cid:" end="\$" oneline contained +syntax region  jsComment        start="/\*"  end="\*/" contains=jsCommentTodo,jsCvsTag,@Spell fold + +"" JSDoc / JSDoc Toolkit +if !exists("javascript_ignore_javaScriptdoc") +  syntax case ignore + +  "" syntax coloring for javadoc comments (HTML) +  "syntax include @javaHtml <sfile>:p:h/html.vim +  "unlet b:current_syntax + +  syntax region jsDocComment      matchgroup=jsComment start="/\*\*\s*"  end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold + +  " tags containing a param +  syntax match  jsDocTags         contained "@\(alias\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|file\|fires\|kind\|listens\|member\|memberOf\|mixes\|module\|name\|namespace\|requires\|throws\|var\|variation\|version\)\>" nextgroup=jsDocParam skipwhite +  " tags containing type and param +  syntax match  jsDocTags         contained "@\(arg\|argument\|param\|property\)\>" nextgroup=jsDocType skipwhite +  " tags containing type but no param +  syntax match  jsDocTags         contained "@\(callback\|enum\|external\|this\|type\|typedef\|return\|returns\)\>" nextgroup=jsDocTypeNoParam skipwhite +  " tags containing references +  syntax match  jsDocTags         contained "@\(lends\|see\)\>" nextgroup=jsDocSeeTag skipwhite +  " other tags (no extra syntax) +  syntax match  jsDocTags         contained "@\(abstract\|access\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|event\|example\|fileOverview\|function\|global\|ignore\|inner\|instance\|license\|method\|mixin\|overview\|private\|protected\|public\|readonly\|since\|static\|todo\|summary\|undocumented\|virtual\)\>" + +  syntax region jsDocType         start="{" end="}" oneline contained nextgroup=jsDocParam skipwhite +  syntax match  jsDocType         contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite +  syntax region jsDocTypeNoParam  start="{" end="}" oneline contained +  syntax match  jsDocTypeNoParam  contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" +  syntax match  jsDocParam        contained "\%(#\|\"\|{\|}\|\w\|\.\|:\|\/\)\+" +  syntax region jsDocSeeTag       contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags + +  syntax case match +endif   "" JSDoc end + +syntax case match + +"" Syntax in the JavaScript code +syntax match   jsFuncCall        /\k\+\%(\s*(\)\@=/ +syntax match   jsSpecial         "\v\\%(0|\\x\x\{2\}\|\\u\x\{4\}\|\c[A-Z]|.)" +syntax region  jsStringD         start=+"+  skip=+\\\\\|\\$"+  end=+"+  contains=jsSpecial,@htmlPreproc +syntax region  jsStringS         start=+'+  skip=+\\\\\|\\$'+  end=+'+  contains=jsSpecial,@htmlPreproc +syntax region  jsRegexpCharClass start=+\[+ end=+\]+ contained +syntax match   jsRegexpBoundary   "\v%(\<@![\^$]|\\[bB])" contained +syntax match   jsRegexpBackRef   "\v\\[1-9][0-9]*" contained +syntax match   jsRegexpQuantifier "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??" contained +syntax match   jsRegexpOr        "\v\<@!\|" contained +syntax match   jsRegexpMod       "\v\(@<=\?[:=!>]" contained +syntax cluster jsRegexpSpecial   contains=jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod +syntax region  jsRegexpGroup     start="\\\@<!(" end="\\\@<!)" contained contains=jsRegexpCharClass,@jsRegexpSpecial keepend +syntax region  jsRegexpString    start=+\(\(\(return\|case\)\s\+\)\@<=\|\(\([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gimy]\{,4}+ contains=jsSpecial,jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial,@htmlPreproc oneline keepend +syntax match   jsNumber          /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/ +syntax keyword jsNumber          Infinity +syntax match   jsFloat           /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/ +syntax match   jsObjectKey       /\<[a-zA-Z_$][0-9a-zA-Z_$]*\(\s*:\)\@=/ contains=jsFunctionKey +syntax match   jsFunctionKey     /\<[a-zA-Z_$][0-9a-zA-Z_$]*\(\s*:\s*function\s*\)\@=/ contained + +"" JavaScript Prototype +syntax keyword jsPrototype      prototype + +if g:javascript_conceal == 1 +  syntax keyword jsNull           null conceal cchar=ø +  syntax keyword jsThis           this conceal cchar=@ +  syntax keyword jsReturn         return conceal cchar=⇚ +  syntax keyword jsUndefined      undefined conceal cchar=¿ +  syntax keyword jsNan            NaN conceal cchar=ℕ +else +  syntax keyword jsNull           null +  syntax keyword jsThis           this +  syntax keyword jsReturn         return +  syntax keyword jsUndefined      undefined +  syntax keyword jsNan            NaN +endif + +"" Statement Keywords +syntax keyword jsStatement      break continue with +syntax keyword jsConditional    if else switch +syntax keyword jsRepeat         do while for +syntax keyword jsLabel          case default +syntax keyword jsKeyword        yield +syntax keyword jsException      try catch throw finally + +syntax keyword jsGlobalObjects   Array Boolean Date Function Iterator Number Object RegExp String Proxy ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray Intl JSON Math console document window +syntax match   jsGlobalObjects  /\%(Intl\.\)\@<=\(Collator\|DateTimeFormat\|NumberFormat\)/ + +syntax keyword jsExceptions     Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError + +syntax keyword jsBuiltins       decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval + +syntax keyword jsFutureKeys     abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws goto private transient debugger implements protected volatile double import public + +"" DOM/HTML/CSS specified things + +  " DOM2 Objects +  syntax keyword jsGlobalObjects  DOMImplementation DocumentFragment Document Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction +  syntax keyword jsExceptions     DOMException + +  " DOM2 CONSTANT +  syntax keyword jsDomErrNo       INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR +  syntax keyword jsDomNodeConsts  ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE + +  " HTML events and internal variables +  syntax case ignore +  syntax keyword jsHtmlEvents     onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize +  syntax case match + +" Follow stuff should be highligh within a special context +" While it can't be handled with context depended with Regex based highlight +" So, turn it off by default +if exists("javascript_enable_domhtmlcss") + +    " DOM2 things +    syntax match jsDomElemAttrs     contained /\%(nodeName\|nodeValue\|nodeType\|parentNode\|childNodes\|firstChild\|lastChild\|previousSibling\|nextSibling\|attributes\|ownerDocument\|namespaceURI\|prefix\|localName\|tagName\)\>/ +    syntax match jsDomElemFuncs     contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=jsParen skipwhite +    " HTML things +    syntax match jsHtmlElemAttrs    contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/ +    syntax match jsHtmlElemFuncs    contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=jsParen skipwhite + +    " CSS Styles in JavaScript +    syntax keyword jsCssStyles      contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition +    syntax keyword jsCssStyles      contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition +    syntax keyword jsCssStyles      contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode +    syntax keyword jsCssStyles      contained bottom height left position right top width zIndex +    syntax keyword jsCssStyles      contained border borderBottom borderLeft borderRight borderTop borderBottomColor borderLeftColor borderTopColor borderBottomStyle borderLeftStyle borderRightStyle borderTopStyle borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderColor borderStyle borderWidth borderCollapse borderSpacing captionSide emptyCells tableLayout +    syntax keyword jsCssStyles      contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop +    syntax keyword jsCssStyles      contained listStyle listStyleImage listStylePosition listStyleType +    syntax keyword jsCssStyles      contained background backgroundAttachment backgroundColor backgroundImage gackgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat +    syntax keyword jsCssStyles      contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType +    syntax keyword jsCssStyles      contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText +    syntax keyword jsCssStyles      contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor + +    " Highlight ways +    syntax match jsDotNotation      "\." nextgroup=jsPrototype,jsDomElemAttrs,jsDomElemFuncs,jsHtmlElemAttrs,jsHtmlElemFuncs +    syntax match jsDotNotation      "\.style\." nextgroup=jsCssStyles + +endif "DOM/HTML/CSS + +"" end DOM/HTML/CSS specified things + + +"" Code blocks +syntax cluster jsExpression contains=jsComment,jsLineComment,jsDocComment,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise +syntax cluster jsAll        contains=@jsExpression,jsLabel,jsConditional,jsRepeat,jsReturn,jsStatement,jsTernaryIf,jsException +syntax region  jsBracket    matchgroup=jsBrackets     start="\[" end="\]" contains=@jsAll,jsParensErrB,jsParensErrC,jsBracket,jsParen,jsBlock,@htmlPreproc fold +syntax region  jsParen      matchgroup=jsParens       start="("  end=")"  contains=@jsAll,jsParensErrA,jsParensErrC,jsParen,jsBracket,jsBlock,@htmlPreproc fold +syntax region  jsBlock      matchgroup=jsBraces       start="{"  end="}"  contains=@jsAll,jsParensErrA,jsParensErrB,jsParen,jsBracket,jsBlock,jsObjectKey,@htmlPreproc fold +syntax region  jsFuncBlock  matchgroup=jsFuncBraces   start="{"  end="}"  contains=@jsAll,jsParensErrA,jsParensErrB,jsParen,jsBracket,jsBlock,@htmlPreproc contained fold +syntax region  jsTernaryIf  matchgroup=jsTernaryIfOperator start=+?+  end=+:+  contains=@jsExpression,jsTernaryIf + +"" catch errors caused by wrong parenthesis +syntax match   jsParensError    ")\|}\|\]" +syntax match   jsParensErrA     contained "\]" +syntax match   jsParensErrB     contained ")" +syntax match   jsParensErrC     contained "}" + +if main_syntax == "javascript" +  syntax sync clear +  syntax sync ccomment jsComment minlines=200 +  syntax sync match jsHighlight grouphere jsBlock /{/ +endif + +if g:javascript_conceal == 1 +  syntax match   jsFunction       /\<function\>/ nextgroup=jsFuncName,jsFuncArgs skipwhite conceal cchar=ƒ +else +  syntax match   jsFunction       /\<function\>/ nextgroup=jsFuncName,jsFuncArgs skipwhite +endif + +syntax match   jsFuncName       contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=jsFuncArgs skipwhite +syntax region  jsFuncArgs       contained matchgroup=jsFuncParens start='(' end=')' contains=jsFuncArgCommas nextgroup=jsFuncBlock keepend skipwhite skipempty +syntax match   jsFuncArgCommas  contained ',' +syntax keyword jsArgsObj        arguments contained containedin=jsFuncBlock + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_javascript_syn_inits") +  if version < 508 +    let did_javascript_syn_inits = 1 +    command -nargs=+ HiLink hi link <args> +  else +    command -nargs=+ HiLink hi def link <args> +  endif +  HiLink jsComment              Comment +  HiLink jsLineComment          Comment +  HiLink jsEnvComment           PreProc +  HiLink jsDocComment           Comment +  HiLink jsCommentTodo          Todo +  HiLink jsCvsTag               Function +  HiLink jsDocTags              Special +  HiLink jsDocSeeTag            Function +  HiLink jsDocType              Type +  HiLink jsDocTypeNoParam       Type +  HiLink jsDocParam             Label +  HiLink jsStringS              String +  HiLink jsStringD              String +  HiLink jsTernaryIfOperator    Conditional +  HiLink jsRegexpString         String +  HiLink jsRegexpBoundary       SpecialChar +  HiLink jsRegexpQuantifier     SpecialChar +  HiLink jsRegexpOr             Conditional +  HiLink jsRegexpMod            SpecialChar +  HiLink jsRegexpBackRef        SpecialChar +  HiLink jsRegexpGroup          jsRegexpString +  HiLink jsRegexpCharClass      Character +  HiLink jsCharacter            Character +  HiLink jsPrototype            Special +  HiLink jsConditional          Conditional +  HiLink jsBranch               Conditional +  HiLink jsLabel                Label +  HiLink jsReturn               Statement +  HiLink jsRepeat               Repeat +  HiLink jsStatement            Statement +  HiLink jsException            Exception +  HiLink jsKeyword              Keyword +  HiLink jsFunction             Type +  HiLink jsFuncName             Function +  HiLink jsArgsObj              Special +  HiLink jsError                Error +  HiLink jsParensError          Error +  HiLink jsParensErrA           Error +  HiLink jsParensErrB           Error +  HiLink jsParensErrC           Error +  HiLink jsOperator             Operator +  HiLink jsStorageClass         StorageClass +  HiLink jsThis                 Special +  HiLink jsNan                  Number +  HiLink jsNull                 Type +  HiLink jsUndefined            Type +  HiLink jsNumber               Number +  HiLink jsFloat                Float +  HiLink jsBooleanTrue          Boolean +  HiLink jsBooleanFalse         Boolean +  HiLink jsNoise                Noise +  HiLink jsBrackets             Noise +  HiLink jsParens               Noise +  HiLink jsBraces               Noise +  HiLink jsFuncBraces           Noise +  HiLink jsFuncParens           Noise +  HiLink jsSpecial              Special +  HiLink jsGlobalObjects        Special +  HiLink jsExceptions           Special +  HiLink jsFutureKeys           Special +  HiLink jsBuiltins             Special + +  HiLink jsDomErrNo             Constant +  HiLink jsDomNodeConsts        Constant +  HiLink jsDomElemAttrs         Label +  HiLink jsDomElemFuncs         PreProc + +  HiLink jsHtmlEvents           Special +  HiLink jsHtmlElemAttrs        Label +  HiLink jsHtmlElemFuncs        PreProc + +  HiLink jsCssStyles            Label + +  delcommand HiLink +endif + +" Define the htmlJavaScript for HTML syntax html.vim +"syntax clear htmlJavaScript +"syntax clear jsExpression +syntax cluster  htmlJavaScript       contains=@jsAll,jsBracket,jsParen,jsBlock +syntax cluster  javaScriptExpression contains=@jsAll,jsBracket,jsParen,jsBlock,@htmlPreproc +" Vim's default html.vim highlights all javascript as 'Special' +hi! def link javaScript              NONE + +let b:current_syntax = "javascript" +if main_syntax == 'javascript' +  unlet main_syntax +endif diff --git a/syntax/json.vim b/syntax/json.vim new file mode 100644 index 00000000..f3e27ba2 --- /dev/null +++ b/syntax/json.vim @@ -0,0 +1,77 @@ +" Vim syntax file +" Language:	JSON +" Maintainer:	Jeroen Ruigrok van der Werven <asmodai@in-nomine.org> +" Last Change:	2009-06-16 +" Version:      0.4 +" {{{1 + +" Syntax setup {{{2 +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded + +if !exists("main_syntax") +  if version < 600 +    syntax clear +  elseif exists("b:current_syntax") +    finish +  endif +  let main_syntax = 'json' +endif + +" Syntax: Strings {{{2 +syn region  jsonString    start=+"+  skip=+\\\\\|\\"+  end=+"+  contains=jsonEscape +" Syntax: JSON does not allow strings with single quotes, unlike JavaScript. +syn region  jsonStringSQ  start=+'+  skip=+\\\\\|\\"+  end=+'+ + +" Syntax: Escape sequences {{{3 +syn match   jsonEscape    "\\["\\/bfnrt]" contained +syn match   jsonEscape    "\\u\x\{4}" contained + +" Syntax: Strings should always be enclosed with quotes. +syn match   jsonNoQuotes  "\<\a\+\>" + +" Syntax: Numbers {{{2 +syn match   jsonNumber    "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>" + +" Syntax: An integer part of 0 followed by other digits is not allowed. +syn match   jsonNumError  "-\=\<0\d\.\d*\>" + +" Syntax: Boolean {{{2 +syn keyword jsonBoolean   true false + +" Syntax: Null {{{2 +syn keyword jsonNull      null + +" Syntax: Braces {{{2 +syn match   jsonBraces	   "[{}\[\]]" + +" Define the default highlighting. {{{1 +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_json_syn_inits") +  if version < 508 +    let did_json_syn_inits = 1 +    command -nargs=+ HiLink hi link <args> +  else +    command -nargs=+ HiLink hi def link <args> +  endif +  HiLink jsonString             String +  HiLink jsonEscape             Special +  HiLink jsonNumber		Number +  HiLink jsonBraces		Operator +  HiLink jsonNull		Function +  HiLink jsonBoolean		Boolean + +  HiLink jsonNumError           Error +  HiLink jsonStringSQ           Error +  HiLink jsonNoQuotes           Error +  delcommand HiLink +endif + +let b:current_syntax = "json" +if main_syntax == 'json' +  unlet main_syntax +endif + +" Vim settings {{{2 +" vim: ts=8 fdm=marker diff --git a/syntax/less.vim b/syntax/less.vim new file mode 100644 index 00000000..fa5a247e --- /dev/null +++ b/syntax/less.vim @@ -0,0 +1,64 @@ +if exists("b:current_syntax") +  finish +endif + +runtime! syntax/css.vim +runtime! after/syntax/css.vim +" load files from vim-css3-syntax plugin (https://github.com/hail2u/vim-css3-syntax) +runtime! after/syntax/css/*.vim + +syn case ignore + +syn region lessDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssTagName,cssPseudoClass,cssUrl,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,lessDefinition,lessComment,lessClassChar,lessVariable,lessMixinChar,lessAmpersandChar,lessFunction,lessNestedSelector,@cssColors fold + +syn match lessVariable "@[[:alnum:]_-]\+" contained +syn match lessVariable "@[[:alnum:]_-]\+" nextgroup=lessVariableAssignment skipwhite +syn match lessVariableAssignment ":" contained nextgroup=lessVariableValue skipwhite +syn match lessVariableValue ".*;"me=e-1 contained contains=lessVariable,lessOperator,lessDefault,cssValue.*,@cssColors "me=e-1 means that the last char of the pattern is not highlighted + +syn match lessOperator "+" contained +syn match lessOperator "-" contained +syn match lessOperator "/" contained +syn match lessOperator "*" contained + +syn match lessNestedSelector "[^/]* {"me=e-1 contained contains=cssTagName,cssAttributeSelector,lessAmpersandChar,lessVariable,lessMixinChar,lessFunction,lessNestedProperty +syn match lessNestedProperty "[[:alnum:]]\+:"me=e-1 contained + +syn match lessDefault "!default" contained + +syn match lessMixinChar "\.[[:alnum:]_-]\@=" contained nextgroup=lessClass +syn match lessAmpersandChar "&" contained nextgroup=lessClass,cssPseudoClass +syn match lessClass "[[:alnum:]_-]\+" contained + +" functions {{{ + +" string functions +syn keyword lessFunction escape e % containedin=cssDefinition contained +" misc functions +syn keyword lessFunction color unit containedin=cssDefinition contained +" math functions +syn keyword lessFunction ceil floor percentage round containedin=cssDefinition contained +" color definition +syn keyword lessFunction rgb rgba argb hsl hsla hsv hsva containedin=cssDefinition contained +" color channel information +syn keyword lessFunction hue saturation lightness red green blue alpha luma containedin=cssDefinition contained +" color operations +syn keyword lessFunction saturate desaturate lighten darken fadein fadeout fade spin mix greyscale contrast containedin=cssDefinition contained +" color blending +syn keyword lessFunction multiply screen overlay softlight hardlight difference exclusion average negation containedin=cssDefinition contained + +" }}} + +syn match lessComment "//.*$" contains=@Spell + +hi def link lessVariable Special +hi def link lessVariableValue Constant +hi def link lessDefault Special +hi def link lessComment Comment +hi def link lessFunction Function +hi def link lessMixinChar Special +hi def link lessAmpersandChar Special +hi def link lessNestedProperty Type +hi def link lessClass PreProc + +let b:current_syntax = "less" diff --git a/syntax/nginx.vim b/syntax/nginx.vim new file mode 100644 index 00000000..ccd47680 --- /dev/null +++ b/syntax/nginx.vim @@ -0,0 +1,664 @@ +" Vim syntax file +" Language: nginx.conf + +if exists("b:current_syntax") +  finish +end + +setlocal iskeyword+=. +setlocal iskeyword+=/ +setlocal iskeyword+=: + +syn match ngxVariable '\$\w\w*' +syn match ngxVariableBlock '\$\w\w*' contained +syn match ngxVariableString '\$\w\w*' contained +syn region ngxBlock start=+^+ end=+{+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline +syn region ngxString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=ngxVariableString oneline +syn region ngxString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=ngxVariableString oneline +syn match ngxComment ' *#.*$' + +syn keyword ngxBoolean on +syn keyword ngxBoolean off + +syn keyword ngxDirectiveBlock http         contained +syn keyword ngxDirectiveBlock mail         contained +syn keyword ngxDirectiveBlock events       contained +syn keyword ngxDirectiveBlock server       contained +syn keyword ngxDirectiveBlock types        contained +syn keyword ngxDirectiveBlock location     contained +syn keyword ngxDirectiveBlock upstream     contained +syn keyword ngxDirectiveBlock charset_map  contained +syn keyword ngxDirectiveBlock limit_except contained +syn keyword ngxDirectiveBlock if           contained +syn keyword ngxDirectiveBlock geo          contained +syn keyword ngxDirectiveBlock map          contained + +syn keyword ngxDirectiveImportant include +syn keyword ngxDirectiveImportant root +syn keyword ngxDirectiveImportant server +syn keyword ngxDirectiveImportant server_name +syn keyword ngxDirectiveImportant listen +syn keyword ngxDirectiveImportant internal +syn keyword ngxDirectiveImportant proxy_pass +syn keyword ngxDirectiveImportant memcached_pass +syn keyword ngxDirectiveImportant fastcgi_pass +syn keyword ngxDirectiveImportant try_files + +syn keyword ngxDirectiveControl break +syn keyword ngxDirectiveControl return +syn keyword ngxDirectiveControl rewrite +syn keyword ngxDirectiveControl set + +syn keyword ngxDirectiveError error_page +syn keyword ngxDirectiveError post_action + +syn keyword ngxDirectiveDeprecated connections +syn keyword ngxDirectiveDeprecated imap +syn keyword ngxDirectiveDeprecated open_file_cache_retest +syn keyword ngxDirectiveDeprecated optimize_server_names +syn keyword ngxDirectiveDeprecated satisfy_any + +syn keyword ngxDirective accept_mutex +syn keyword ngxDirective accept_mutex_delay +syn keyword ngxDirective access_log +syn keyword ngxDirective add_after_body +syn keyword ngxDirective add_before_body +syn keyword ngxDirective add_header +syn keyword ngxDirective addition_types +syn keyword ngxDirective aio +syn keyword ngxDirective alias +syn keyword ngxDirective allow +syn keyword ngxDirective ancient_browser +syn keyword ngxDirective ancient_browser_value +syn keyword ngxDirective auth_basic +syn keyword ngxDirective auth_basic_user_file +syn keyword ngxDirective auth_http +syn keyword ngxDirective auth_http_header +syn keyword ngxDirective auth_http_timeout +syn keyword ngxDirective autoindex +syn keyword ngxDirective autoindex_exact_size +syn keyword ngxDirective autoindex_localtime +syn keyword ngxDirective charset +syn keyword ngxDirective charset_types +syn keyword ngxDirective client_body_buffer_size +syn keyword ngxDirective client_body_in_file_only +syn keyword ngxDirective client_body_in_single_buffer +syn keyword ngxDirective client_body_temp_path +syn keyword ngxDirective client_body_timeout +syn keyword ngxDirective client_header_buffer_size +syn keyword ngxDirective client_header_timeout +syn keyword ngxDirective client_max_body_size +syn keyword ngxDirective connection_pool_size +syn keyword ngxDirective create_full_put_path +syn keyword ngxDirective daemon +syn keyword ngxDirective dav_access +syn keyword ngxDirective dav_methods +syn keyword ngxDirective debug_connection +syn keyword ngxDirective debug_points +syn keyword ngxDirective default_type +syn keyword ngxDirective degradation +syn keyword ngxDirective degrade +syn keyword ngxDirective deny +syn keyword ngxDirective devpoll_changes +syn keyword ngxDirective devpoll_events +syn keyword ngxDirective directio +syn keyword ngxDirective directio_alignment +syn keyword ngxDirective empty_gif +syn keyword ngxDirective env +syn keyword ngxDirective epoll_events +syn keyword ngxDirective error_log +syn keyword ngxDirective eventport_events +syn keyword ngxDirective expires +syn keyword ngxDirective fastcgi_bind +syn keyword ngxDirective fastcgi_buffer_size +syn keyword ngxDirective fastcgi_buffers +syn keyword ngxDirective fastcgi_busy_buffers_size +syn keyword ngxDirective fastcgi_cache +syn keyword ngxDirective fastcgi_cache_key +syn keyword ngxDirective fastcgi_cache_methods +syn keyword ngxDirective fastcgi_cache_min_uses +syn keyword ngxDirective fastcgi_cache_path +syn keyword ngxDirective fastcgi_cache_use_stale +syn keyword ngxDirective fastcgi_cache_valid +syn keyword ngxDirective fastcgi_catch_stderr +syn keyword ngxDirective fastcgi_connect_timeout +syn keyword ngxDirective fastcgi_hide_header +syn keyword ngxDirective fastcgi_ignore_client_abort +syn keyword ngxDirective fastcgi_ignore_headers +syn keyword ngxDirective fastcgi_index +syn keyword ngxDirective fastcgi_intercept_errors +syn keyword ngxDirective fastcgi_max_temp_file_size +syn keyword ngxDirective fastcgi_next_upstream +syn keyword ngxDirective fastcgi_param +syn keyword ngxDirective fastcgi_pass_header +syn keyword ngxDirective fastcgi_pass_request_body +syn keyword ngxDirective fastcgi_pass_request_headers +syn keyword ngxDirective fastcgi_read_timeout +syn keyword ngxDirective fastcgi_send_lowat +syn keyword ngxDirective fastcgi_send_timeout +syn keyword ngxDirective fastcgi_split_path_info +syn keyword ngxDirective fastcgi_store +syn keyword ngxDirective fastcgi_store_access +syn keyword ngxDirective fastcgi_temp_file_write_size +syn keyword ngxDirective fastcgi_temp_path +syn keyword ngxDirective fastcgi_upstream_fail_timeout +syn keyword ngxDirective fastcgi_upstream_max_fails +syn keyword ngxDirective flv +syn keyword ngxDirective geoip_city +syn keyword ngxDirective geoip_country +syn keyword ngxDirective google_perftools_profiles +syn keyword ngxDirective gzip +syn keyword ngxDirective gzip_buffers +syn keyword ngxDirective gzip_comp_level +syn keyword ngxDirective gzip_disable +syn keyword ngxDirective gzip_hash +syn keyword ngxDirective gzip_http_version +syn keyword ngxDirective gzip_min_length +syn keyword ngxDirective gzip_no_buffer +syn keyword ngxDirective gzip_proxied +syn keyword ngxDirective gzip_static +syn keyword ngxDirective gzip_types +syn keyword ngxDirective gzip_vary +syn keyword ngxDirective gzip_window +syn keyword ngxDirective if_modified_since +syn keyword ngxDirective ignore_invalid_headers +syn keyword ngxDirective image_filter +syn keyword ngxDirective image_filter_buffer +syn keyword ngxDirective image_filter_jpeg_quality +syn keyword ngxDirective image_filter_transparency +syn keyword ngxDirective imap_auth +syn keyword ngxDirective imap_capabilities +syn keyword ngxDirective imap_client_buffer +syn keyword ngxDirective index +syn keyword ngxDirective ip_hash +syn keyword ngxDirective keepalive_requests +syn keyword ngxDirective keepalive_timeout +syn keyword ngxDirective kqueue_changes +syn keyword ngxDirective kqueue_events +syn keyword ngxDirective large_client_header_buffers +syn keyword ngxDirective limit_conn +syn keyword ngxDirective limit_conn_log_level +syn keyword ngxDirective limit_rate +syn keyword ngxDirective limit_rate_after +syn keyword ngxDirective limit_req +syn keyword ngxDirective limit_req_log_level +syn keyword ngxDirective limit_req_zone +syn keyword ngxDirective limit_zone +syn keyword ngxDirective lingering_time +syn keyword ngxDirective lingering_timeout +syn keyword ngxDirective lock_file +syn keyword ngxDirective log_format +syn keyword ngxDirective log_not_found +syn keyword ngxDirective log_subrequest +syn keyword ngxDirective map_hash_bucket_size +syn keyword ngxDirective map_hash_max_size +syn keyword ngxDirective master_process +syn keyword ngxDirective memcached_bind +syn keyword ngxDirective memcached_buffer_size +syn keyword ngxDirective memcached_connect_timeout +syn keyword ngxDirective memcached_next_upstream +syn keyword ngxDirective memcached_read_timeout +syn keyword ngxDirective memcached_send_timeout +syn keyword ngxDirective memcached_upstream_fail_timeout +syn keyword ngxDirective memcached_upstream_max_fails +syn keyword ngxDirective merge_slashes +syn keyword ngxDirective min_delete_depth +syn keyword ngxDirective modern_browser +syn keyword ngxDirective modern_browser_value +syn keyword ngxDirective msie_padding +syn keyword ngxDirective msie_refresh +syn keyword ngxDirective multi_accept +syn keyword ngxDirective open_file_cache +syn keyword ngxDirective open_file_cache_errors +syn keyword ngxDirective open_file_cache_events +syn keyword ngxDirective open_file_cache_min_uses +syn keyword ngxDirective open_file_cache_valid +syn keyword ngxDirective open_log_file_cache +syn keyword ngxDirective output_buffers +syn keyword ngxDirective override_charset +syn keyword ngxDirective perl +syn keyword ngxDirective perl_modules +syn keyword ngxDirective perl_require +syn keyword ngxDirective perl_set +syn keyword ngxDirective pid +syn keyword ngxDirective pop3_auth +syn keyword ngxDirective pop3_capabilities +syn keyword ngxDirective port_in_redirect +syn keyword ngxDirective postpone_gzipping +syn keyword ngxDirective postpone_output +syn keyword ngxDirective protocol +syn keyword ngxDirective proxy +syn keyword ngxDirective proxy_bind +syn keyword ngxDirective proxy_buffer +syn keyword ngxDirective proxy_buffer_size +syn keyword ngxDirective proxy_buffering +syn keyword ngxDirective proxy_buffers +syn keyword ngxDirective proxy_busy_buffers_size +syn keyword ngxDirective proxy_cache +syn keyword ngxDirective proxy_cache_key +syn keyword ngxDirective proxy_cache_methods +syn keyword ngxDirective proxy_cache_min_uses +syn keyword ngxDirective proxy_cache_path +syn keyword ngxDirective proxy_cache_use_stale +syn keyword ngxDirective proxy_cache_valid +syn keyword ngxDirective proxy_connect_timeout +syn keyword ngxDirective proxy_headers_hash_bucket_size +syn keyword ngxDirective proxy_headers_hash_max_size +syn keyword ngxDirective proxy_hide_header +syn keyword ngxDirective proxy_ignore_client_abort +syn keyword ngxDirective proxy_ignore_headers +syn keyword ngxDirective proxy_intercept_errors +syn keyword ngxDirective proxy_max_temp_file_size +syn keyword ngxDirective proxy_method +syn keyword ngxDirective proxy_next_upstream +syn keyword ngxDirective proxy_pass_error_message +syn keyword ngxDirective proxy_pass_header +syn keyword ngxDirective proxy_pass_request_body +syn keyword ngxDirective proxy_pass_request_headers +syn keyword ngxDirective proxy_read_timeout +syn keyword ngxDirective proxy_redirect +syn keyword ngxDirective proxy_send_lowat +syn keyword ngxDirective proxy_send_timeout +syn keyword ngxDirective proxy_set_body +syn keyword ngxDirective proxy_set_header +syn keyword ngxDirective proxy_ssl_session_reuse +syn keyword ngxDirective proxy_store +syn keyword ngxDirective proxy_store_access +syn keyword ngxDirective proxy_temp_file_write_size +syn keyword ngxDirective proxy_temp_path +syn keyword ngxDirective proxy_timeout +syn keyword ngxDirective proxy_upstream_fail_timeout +syn keyword ngxDirective proxy_upstream_max_fails +syn keyword ngxDirective random_index +syn keyword ngxDirective read_ahead +syn keyword ngxDirective real_ip_header +syn keyword ngxDirective recursive_error_pages +syn keyword ngxDirective request_pool_size +syn keyword ngxDirective reset_timedout_connection +syn keyword ngxDirective resolver +syn keyword ngxDirective resolver_timeout +syn keyword ngxDirective rewrite_log +syn keyword ngxDirective rtsig_overflow_events +syn keyword ngxDirective rtsig_overflow_test +syn keyword ngxDirective rtsig_overflow_threshold +syn keyword ngxDirective rtsig_signo +syn keyword ngxDirective satisfy +syn keyword ngxDirective secure_link_secret +syn keyword ngxDirective send_lowat +syn keyword ngxDirective send_timeout +syn keyword ngxDirective sendfile +syn keyword ngxDirective sendfile_max_chunk +syn keyword ngxDirective server_name_in_redirect +syn keyword ngxDirective server_names_hash_bucket_size +syn keyword ngxDirective server_names_hash_max_size +syn keyword ngxDirective server_tokens +syn keyword ngxDirective set_real_ip_from +syn keyword ngxDirective smtp_auth +syn keyword ngxDirective smtp_capabilities +syn keyword ngxDirective smtp_client_buffer +syn keyword ngxDirective smtp_greeting_delay +syn keyword ngxDirective so_keepalive +syn keyword ngxDirective source_charset +syn keyword ngxDirective ssi +syn keyword ngxDirective ssi_ignore_recycled_buffers +syn keyword ngxDirective ssi_min_file_chunk +syn keyword ngxDirective ssi_silent_errors +syn keyword ngxDirective ssi_types +syn keyword ngxDirective ssi_value_length +syn keyword ngxDirective ssl +syn keyword ngxDirective ssl_certificate +syn keyword ngxDirective ssl_certificate_key +syn keyword ngxDirective ssl_ciphers +syn keyword ngxDirective ssl_client_certificate +syn keyword ngxDirective ssl_crl +syn keyword ngxDirective ssl_dhparam +syn keyword ngxDirective ssl_engine +syn keyword ngxDirective ssl_prefer_server_ciphers +syn keyword ngxDirective ssl_protocols +syn keyword ngxDirective ssl_session_cache +syn keyword ngxDirective ssl_session_timeout +syn keyword ngxDirective ssl_verify_client +syn keyword ngxDirective ssl_verify_depth +syn keyword ngxDirective starttls +syn keyword ngxDirective stub_status +syn keyword ngxDirective sub_filter +syn keyword ngxDirective sub_filter_once +syn keyword ngxDirective sub_filter_types +syn keyword ngxDirective tcp_nodelay +syn keyword ngxDirective tcp_nopush +syn keyword ngxDirective thread_stack_size +syn keyword ngxDirective timeout +syn keyword ngxDirective timer_resolution +syn keyword ngxDirective types_hash_bucket_size +syn keyword ngxDirective types_hash_max_size +syn keyword ngxDirective underscores_in_headers +syn keyword ngxDirective uninitialized_variable_warn +syn keyword ngxDirective use +syn keyword ngxDirective user +syn keyword ngxDirective userid +syn keyword ngxDirective userid_domain +syn keyword ngxDirective userid_expires +syn keyword ngxDirective userid_mark +syn keyword ngxDirective userid_name +syn keyword ngxDirective userid_p3p +syn keyword ngxDirective userid_path +syn keyword ngxDirective userid_service +syn keyword ngxDirective valid_referers +syn keyword ngxDirective variables_hash_bucket_size +syn keyword ngxDirective variables_hash_max_size +syn keyword ngxDirective worker_connections +syn keyword ngxDirective worker_cpu_affinity +syn keyword ngxDirective worker_priority +syn keyword ngxDirective worker_processes +syn keyword ngxDirective worker_rlimit_core +syn keyword ngxDirective worker_rlimit_nofile +syn keyword ngxDirective worker_rlimit_sigpending +syn keyword ngxDirective worker_threads +syn keyword ngxDirective working_directory +syn keyword ngxDirective xclient +syn keyword ngxDirective xml_entities +syn keyword ngxDirective xslt_stylesheet +syn keyword ngxDirective xslt_types + +" 3rd party module list: +" http://wiki.nginx.org/Nginx3rdPartyModules + +" Accept Language Module <http://wiki.nginx.org/NginxAcceptLanguageModule> +" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales. +syn keyword ngxDirectiveThirdParty set_from_accept_language + +" Access Key Module <http://wiki.nginx.org/NginxHttpAccessKeyModule> +" Denies access unless the request URL contains an access key.  +syn keyword ngxDirectiveThirdParty accesskey +syn keyword ngxDirectiveThirdParty accesskey_arg +syn keyword ngxDirectiveThirdParty accesskey_hashmethod +syn keyword ngxDirectiveThirdParty accesskey_signature + +" Auth PAM Module <http://web.iti.upv.es/~sto/nginx/> +" HTTP Basic Authentication using PAM. +syn keyword ngxDirectiveThirdParty auth_pam +syn keyword ngxDirectiveThirdParty auth_pam_service_name + +" Cache Purge Module <http://labs.frickle.com/nginx_ngx_cache_purge/> +" Module adding ability to purge content from FastCGI and proxy caches. +syn keyword ngxDirectiveThirdParty fastcgi_cache_purge +syn keyword ngxDirectiveThirdParty proxy_cache_purge + +" Chunkin Module <http://wiki.nginx.org/NginxHttpChunkinModule> +" HTTP 1.1 chunked-encoding request body support for Nginx. +syn keyword ngxDirectiveThirdParty chunkin +syn keyword ngxDirectiveThirdParty chunkin_keepalive +syn keyword ngxDirectiveThirdParty chunkin_max_chunks_per_buf +syn keyword ngxDirectiveThirdParty chunkin_resume + +" Circle GIF Module <http://wiki.nginx.org/NginxHttpCircleGifModule> +" Generates simple circle images with the colors and size specified in the URL. +syn keyword ngxDirectiveThirdParty circle_gif +syn keyword ngxDirectiveThirdParty circle_gif_max_radius +syn keyword ngxDirectiveThirdParty circle_gif_min_radius +syn keyword ngxDirectiveThirdParty circle_gif_step_radius + +" Drizzle Module <http://github.com/chaoslawful/drizzle-nginx-module> +" Make nginx talk directly to mysql, drizzle, and sqlite3 by libdrizzle. +syn keyword ngxDirectiveThirdParty drizzle_connect_timeout +syn keyword ngxDirectiveThirdParty drizzle_dbname +syn keyword ngxDirectiveThirdParty drizzle_keepalive +syn keyword ngxDirectiveThirdParty drizzle_module_header +syn keyword ngxDirectiveThirdParty drizzle_pass +syn keyword ngxDirectiveThirdParty drizzle_query +syn keyword ngxDirectiveThirdParty drizzle_recv_cols_timeout +syn keyword ngxDirectiveThirdParty drizzle_recv_rows_timeout +syn keyword ngxDirectiveThirdParty drizzle_send_query_timeout +syn keyword ngxDirectiveThirdParty drizzle_server + +" Echo Module <http://wiki.nginx.org/NginxHttpEchoModule> +" Brings 'echo', 'sleep', 'time', 'exec' and more shell-style goodies to Nginx config file. +syn keyword ngxDirectiveThirdParty echo +syn keyword ngxDirectiveThirdParty echo_after_body +syn keyword ngxDirectiveThirdParty echo_before_body +syn keyword ngxDirectiveThirdParty echo_blocking_sleep +syn keyword ngxDirectiveThirdParty echo_duplicate +syn keyword ngxDirectiveThirdParty echo_end +syn keyword ngxDirectiveThirdParty echo_exec +syn keyword ngxDirectiveThirdParty echo_flush +syn keyword ngxDirectiveThirdParty echo_foreach_split +syn keyword ngxDirectiveThirdParty echo_location +syn keyword ngxDirectiveThirdParty echo_location_async +syn keyword ngxDirectiveThirdParty echo_read_request_body +syn keyword ngxDirectiveThirdParty echo_request_body +syn keyword ngxDirectiveThirdParty echo_reset_timer +syn keyword ngxDirectiveThirdParty echo_sleep +syn keyword ngxDirectiveThirdParty echo_subrequest +syn keyword ngxDirectiveThirdParty echo_subrequest_async + +" Events Module <http://docs.dutov.org/nginx_modules_events_en.html> +" Privides options for start/stop events. +syn keyword ngxDirectiveThirdParty on_start +syn keyword ngxDirectiveThirdParty on_stop + +" EY Balancer Module <http://github.com/ry/nginx-ey-balancer> +" Adds a request queue to Nginx that allows the limiting of concurrent requests passed to the upstream. +syn keyword ngxDirectiveThirdParty max_connections +syn keyword ngxDirectiveThirdParty max_connections_max_queue_length +syn keyword ngxDirectiveThirdParty max_connections_queue_timeout + +" Fancy Indexes Module <https://connectical.com/projects/ngx-fancyindex/wiki> +" Like the built-in autoindex module, but fancier. +syn keyword ngxDirectiveThirdParty fancyindex +syn keyword ngxDirectiveThirdParty fancyindex_exact_size +syn keyword ngxDirectiveThirdParty fancyindex_footer +syn keyword ngxDirectiveThirdParty fancyindex_header +syn keyword ngxDirectiveThirdParty fancyindex_localtime +syn keyword ngxDirectiveThirdParty fancyindex_readme +syn keyword ngxDirectiveThirdParty fancyindex_readme_mode + +" GeoIP Module (DEPRECATED) <http://wiki.nginx.org/NginxHttp3rdPartyGeoIPModule> +" Country code lookups via the MaxMind GeoIP API. +syn keyword ngxDirectiveThirdParty geoip_country_file + +" Headers More Module <http://wiki.nginx.org/NginxHttpHeadersMoreModule> +" Set and clear input and output headers...more than "add"! +syn keyword ngxDirectiveThirdParty more_clear_headers +syn keyword ngxDirectiveThirdParty more_clear_input_headers +syn keyword ngxDirectiveThirdParty more_set_headers +syn keyword ngxDirectiveThirdParty more_set_input_headers + +" HTTP Push Module <http://pushmodule.slact.net/> +" Turn Nginx into an adept long-polling HTTP Push (Comet) server. +syn keyword ngxDirectiveThirdParty push_buffer_size +syn keyword ngxDirectiveThirdParty push_listener +syn keyword ngxDirectiveThirdParty push_message_timeout +syn keyword ngxDirectiveThirdParty push_queue_messages +syn keyword ngxDirectiveThirdParty push_sender + +" HTTP Redis Module <http://people.FreeBSD.ORG/~osa/ngx_http_redis-0.3.1.tar.gz>> +" Redis <http://code.google.com/p/redis/> support.> +syn keyword ngxDirectiveThirdParty redis_bind +syn keyword ngxDirectiveThirdParty redis_buffer_size +syn keyword ngxDirectiveThirdParty redis_connect_timeout +syn keyword ngxDirectiveThirdParty redis_next_upstream +syn keyword ngxDirectiveThirdParty redis_pass +syn keyword ngxDirectiveThirdParty redis_read_timeout +syn keyword ngxDirectiveThirdParty redis_send_timeout + +" HTTP JavaScript Module <http://wiki.github.com/kung-fu-tzu/ngx_http_js_module> +" Embedding SpiderMonkey. Nearly full port on Perl module. +syn keyword ngxDirectiveThirdParty js +syn keyword ngxDirectiveThirdParty js_filter +syn keyword ngxDirectiveThirdParty js_filter_types +syn keyword ngxDirectiveThirdParty js_load +syn keyword ngxDirectiveThirdParty js_maxmem +syn keyword ngxDirectiveThirdParty js_require +syn keyword ngxDirectiveThirdParty js_set +syn keyword ngxDirectiveThirdParty js_utf8 + +" Log Request Speed <http://wiki.nginx.org/NginxHttpLogRequestSpeed> +" Log the time it took to process each request. +syn keyword ngxDirectiveThirdParty log_request_speed_filter +syn keyword ngxDirectiveThirdParty log_request_speed_filter_timeout + +" Memc Module <http://wiki.nginx.org/NginxHttpMemcModule> +" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands. +syn keyword ngxDirectiveThirdParty memc_buffer_size +syn keyword ngxDirectiveThirdParty memc_cmds_allowed +syn keyword ngxDirectiveThirdParty memc_connect_timeout +syn keyword ngxDirectiveThirdParty memc_flags_to_last_modified +syn keyword ngxDirectiveThirdParty memc_next_upstream +syn keyword ngxDirectiveThirdParty memc_pass +syn keyword ngxDirectiveThirdParty memc_read_timeout +syn keyword ngxDirectiveThirdParty memc_send_timeout +syn keyword ngxDirectiveThirdParty memc_upstream_fail_timeout +syn keyword ngxDirectiveThirdParty memc_upstream_max_fails + +" Mogilefs Module <http://www.grid.net.ru/nginx/mogilefs.en.html> +" Implements a MogileFS client, provides a replace to the Perlbal reverse proxy of the original MogileFS. +syn keyword ngxDirectiveThirdParty mogilefs_connect_timeout +syn keyword ngxDirectiveThirdParty mogilefs_domain +syn keyword ngxDirectiveThirdParty mogilefs_methods +syn keyword ngxDirectiveThirdParty mogilefs_noverify +syn keyword ngxDirectiveThirdParty mogilefs_pass +syn keyword ngxDirectiveThirdParty mogilefs_read_timeout +syn keyword ngxDirectiveThirdParty mogilefs_send_timeout +syn keyword ngxDirectiveThirdParty mogilefs_tracker + +" MP4 Streaming Lite Module <http://wiki.nginx.org/NginxMP4StreamingLite> +" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL.  +syn keyword ngxDirectiveThirdParty mp4 + +" Nginx Notice Module <http://xph.us/software/nginx-notice/> +" Serve static file to POST requests. +syn keyword ngxDirectiveThirdParty notice +syn keyword ngxDirectiveThirdParty notice_type + +" Phusion Passenger <http://www.modrails.com/documentation.html> +" Easy and robust deployment of Ruby on Rails application on Apache and Nginx webservers. +syn keyword ngxDirectiveThirdParty passenger_base_uri +syn keyword ngxDirectiveThirdParty passenger_default_user +syn keyword ngxDirectiveThirdParty passenger_enabled +syn keyword ngxDirectiveThirdParty passenger_log_level +syn keyword ngxDirectiveThirdParty passenger_max_instances_per_app +syn keyword ngxDirectiveThirdParty passenger_max_pool_size +syn keyword ngxDirectiveThirdParty passenger_pool_idle_time +syn keyword ngxDirectiveThirdParty passenger_root +syn keyword ngxDirectiveThirdParty passenger_ruby +syn keyword ngxDirectiveThirdParty passenger_use_global_queue +syn keyword ngxDirectiveThirdParty passenger_user_switching +syn keyword ngxDirectiveThirdParty rack_env +syn keyword ngxDirectiveThirdParty rails_app_spawner_idle_time +syn keyword ngxDirectiveThirdParty rails_env +syn keyword ngxDirectiveThirdParty rails_framework_spawner_idle_time +syn keyword ngxDirectiveThirdParty rails_spawn_method + +" RDS JSON Module <http://github.com/agentzh/rds-json-nginx-module> +" Help ngx_drizzle and other DBD modules emit JSON data. +syn keyword ngxDirectiveThirdParty rds_json +syn keyword ngxDirectiveThirdParty rds_json_content_type +syn keyword ngxDirectiveThirdParty rds_json_format +syn keyword ngxDirectiveThirdParty rds_json_ret + +" RRD Graph Module <http://wiki.nginx.org/NginxNgx_rrd_graph> +" This module provides an HTTP interface to RRDtool's graphing facilities. +syn keyword ngxDirectiveThirdParty rrd_graph +syn keyword ngxDirectiveThirdParty rrd_graph_root + +" Secure Download <http://wiki.nginx.org/NginxHttpSecureDownload> +" Create expiring links. +syn keyword ngxDirectiveThirdParty secure_download +syn keyword ngxDirectiveThirdParty secure_download_fail_location +syn keyword ngxDirectiveThirdParty secure_download_path_mode +syn keyword ngxDirectiveThirdParty secure_download_secret + +" SlowFS Cache Module <http://labs.frickle.com/nginx_ngx_slowfs_cache/> +" Module adding ability to cache static files. +syn keyword ngxDirectiveThirdParty slowfs_big_file_size +syn keyword ngxDirectiveThirdParty slowfs_cache +syn keyword ngxDirectiveThirdParty slowfs_cache_key +syn keyword ngxDirectiveThirdParty slowfs_cache_min_uses +syn keyword ngxDirectiveThirdParty slowfs_cache_path +syn keyword ngxDirectiveThirdParty slowfs_cache_purge +syn keyword ngxDirectiveThirdParty slowfs_cache_valid +syn keyword ngxDirectiveThirdParty slowfs_temp_path + +" Strip Module <http://wiki.nginx.org/NginxHttpStripModule> +" Whitespace remover. +syn keyword ngxDirectiveThirdParty strip + +" Substitutions Module <http://wiki.nginx.org/NginxHttpSubsModule> +" A filter module which can do both regular expression and fixed string substitutions on response bodies. +syn keyword ngxDirectiveThirdParty subs_filter +syn keyword ngxDirectiveThirdParty subs_filter_types + +" Supervisord Module <http://labs.frickle.com/nginx_ngx_supervisord/> +" Module providing nginx with API to communicate with supervisord and manage (start/stop) backends on-demand. +syn keyword ngxDirectiveThirdParty supervisord +syn keyword ngxDirectiveThirdParty supervisord_inherit_backend_status +syn keyword ngxDirectiveThirdParty supervisord_name +syn keyword ngxDirectiveThirdParty supervisord_start +syn keyword ngxDirectiveThirdParty supervisord_stop + +" Upload Module <http://www.grid.net.ru/nginx/upload.en.html> +" Parses multipart/form-data allowing arbitrary handling of uploaded files. +syn keyword ngxDirectiveThirdParty upload_aggregate_form_field +syn keyword ngxDirectiveThirdParty upload_buffer_size +syn keyword ngxDirectiveThirdParty upload_cleanup +syn keyword ngxDirectiveThirdParty upload_limit_rate +syn keyword ngxDirectiveThirdParty upload_max_file_size +syn keyword ngxDirectiveThirdParty upload_max_output_body_len +syn keyword ngxDirectiveThirdParty upload_max_part_header_len +syn keyword ngxDirectiveThirdParty upload_pass +syn keyword ngxDirectiveThirdParty upload_pass_args +syn keyword ngxDirectiveThirdParty upload_pass_form_field +syn keyword ngxDirectiveThirdParty upload_set_form_field +syn keyword ngxDirectiveThirdParty upload_store +syn keyword ngxDirectiveThirdParty upload_store_access + +" Upload Progress Module <http://wiki.nginx.org/NginxHttpUploadProgressModule> +" Tracks and reports upload progress. +syn keyword ngxDirectiveThirdParty report_uploads +syn keyword ngxDirectiveThirdParty track_uploads +syn keyword ngxDirectiveThirdParty upload_progress +syn keyword ngxDirectiveThirdParty upload_progress_content_type +syn keyword ngxDirectiveThirdParty upload_progress_header +syn keyword ngxDirectiveThirdParty upload_progress_json_output +syn keyword ngxDirectiveThirdParty upload_progress_template + +" Upstream Fair Balancer <http://wiki.nginx.org/NginxHttpUpstreamFairModule> +" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin. +syn keyword ngxDirectiveThirdParty fair +syn keyword ngxDirectiveThirdParty upstream_fair_shm_size + +" Upstream Consistent Hash <http://wiki.nginx.org/NginxHttpUpstreamConsistentHash> +" Select backend based on Consistent hash ring. +syn keyword ngxDirectiveThirdParty consistent_hash + +" Upstream Hash Module <http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule> +" Provides simple upstream load distribution by hashing a configurable variable. +syn keyword ngxDirectiveThirdParty hash +syn keyword ngxDirectiveThirdParty hash_again + +" XSS Module <http://github.com/agentzh/xss-nginx-module> +" Native support for cross-site scripting (XSS) in an nginx. +syn keyword ngxDirectiveThirdParty xss_callback_arg +syn keyword ngxDirectiveThirdParty xss_get +syn keyword ngxDirectiveThirdParty xss_input_types +syn keyword ngxDirectiveThirdParty xss_output_type + +" highlight + +hi link ngxComment Comment +hi link ngxVariable Identifier +hi link ngxVariableBlock Identifier +hi link ngxVariableString PreProc +hi link ngxBlock Normal +hi link ngxString String + +hi link ngxBoolean Boolean +hi link ngxDirectiveBlock Statement +hi link ngxDirectiveImportant Type +hi link ngxDirectiveControl Keyword +hi link ngxDirectiveError Constant +hi link ngxDirectiveDeprecated Error +hi link ngxDirective Identifier +hi link ngxDirectiveThirdParty Special + +let b:current_syntax = "nginx" diff --git a/syntax/ocaml.vim b/syntax/ocaml.vim new file mode 100644 index 00000000..e2abc552 --- /dev/null +++ b/syntax/ocaml.vim @@ -0,0 +1,331 @@ +" Vim syntax file +" Language:     OCaml +" Filenames:    *.ml *.mli *.mll *.mly +" Maintainers:  Markus Mottl      <markus.mottl@gmail.com> +"               Karl-Heinz Sylla  <Karl-Heinz.Sylla@gmd.de> +"               Issac Trotts      <ijtrotts@ucdavis.edu> +" URL:          http://www.ocaml.info/vim/syntax/ocaml.vim +" Last Change:  2010 Oct 11 - Added highlighting of lnot (MM, thanks to Erick Matsen) +"               2010 Sep 03 - Fixed escaping bug (MM, thanks to Florent Monnier) +"               2010 Aug 07 - Fixed module type bug (MM) + +" A minor patch was applied to the official version so that object/end +" can be distinguished from begin/end, which is used for indentation, +" and folding. (David Baelde) + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 +  syntax clear +elseif exists("b:current_syntax") && b:current_syntax == "ocaml" +  finish +endif + +" OCaml is case sensitive. +syn case match + +" Access to the method of an object +syn match    ocamlMethod       "#" + +" Script headers highlighted like comments +syn match    ocamlComment   "^#!.*" + +" Scripting directives +syn match    ocamlScript "^#\<\(quit\|labels\|warnings\|directory\|cd\|load\|use\|install_printer\|remove_printer\|require\|thread\|trace\|untrace\|untrace_all\|print_depth\|print_length\|camlp4o\)\>" + +" lowercase identifier - the standard way to match +syn match    ocamlLCIdentifier /\<\(\l\|_\)\(\w\|'\)*\>/ + +syn match    ocamlKeyChar    "|" + +" Errors +syn match    ocamlBraceErr   "}" +syn match    ocamlBrackErr   "\]" +syn match    ocamlParenErr   ")" +syn match    ocamlArrErr     "|]" + +syn match    ocamlCommentErr "\*)" + +syn match    ocamlCountErr   "\<downto\>" +syn match    ocamlCountErr   "\<to\>" + +if !exists("ocaml_revised") +  syn match    ocamlDoErr      "\<do\>" +endif + +syn match    ocamlDoneErr    "\<done\>" +syn match    ocamlThenErr    "\<then\>" + +" Error-highlighting of "end" without synchronization: +" as keyword or as error (default) +if exists("ocaml_noend_error") +  syn match    ocamlKeyword    "\<end\>" +else +  syn match    ocamlEndErr     "\<end\>" +endif + +" Some convenient clusters +syn cluster  ocamlAllErrs contains=ocamlBraceErr,ocamlBrackErr,ocamlParenErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr + +syn cluster  ocamlAENoParen contains=ocamlBraceErr,ocamlBrackErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr + +syn cluster  ocamlContained contains=ocamlTodo,ocamlPreDef,ocamlModParam,ocamlModParam1,ocamlPreMPRestr,ocamlMPRestr,ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3,ocamlModRHS,ocamlFuncWith,ocamlFuncStruct,ocamlModTypeRestr,ocamlModTRWith,ocamlWith,ocamlWithRest,ocamlModType,ocamlFullMod,ocamlVal + + +" Enclosing delimiters +syn region   ocamlEncl transparent matchgroup=ocamlKeyword start="(" matchgroup=ocamlKeyword end=")" contains=ALLBUT,@ocamlContained,ocamlParenErr +syn region   ocamlEncl transparent matchgroup=ocamlKeyword start="{" matchgroup=ocamlKeyword end="}"  contains=ALLBUT,@ocamlContained,ocamlBraceErr +syn region   ocamlEncl transparent matchgroup=ocamlKeyword start="\[" matchgroup=ocamlKeyword end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr +syn region   ocamlEncl transparent matchgroup=ocamlKeyword start="\[|" matchgroup=ocamlKeyword end="|\]" contains=ALLBUT,@ocamlContained,ocamlArrErr + + +" Comments +syn region   ocamlComment start="(\*" end="\*)" contains=ocamlComment,ocamlTodo +syn keyword  ocamlTodo contained TODO FIXME XXX NOTE + + +" Objects +syn region   ocamlEnd matchgroup=ocamlObject start="\<object\>" matchgroup=ocamlObject end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr + + +" Blocks +if !exists("ocaml_revised") +  syn region   ocamlEnd matchgroup=ocamlKeyword start="\<begin\>" matchgroup=ocamlKeyword end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr +endif + + +" "for" +syn region   ocamlNone matchgroup=ocamlKeyword start="\<for\>" matchgroup=ocamlKeyword end="\<\(to\|downto\)\>" contains=ALLBUT,@ocamlContained,ocamlCountErr + + +" "do" +if !exists("ocaml_revised") +  syn region   ocamlDo matchgroup=ocamlKeyword start="\<do\>" matchgroup=ocamlKeyword end="\<done\>" contains=ALLBUT,@ocamlContained,ocamlDoneErr +endif + +" "if" +syn region   ocamlNone matchgroup=ocamlKeyword start="\<if\>" matchgroup=ocamlKeyword end="\<then\>" contains=ALLBUT,@ocamlContained,ocamlThenErr + + +"" Modules + +" "sig" +syn region   ocamlSig matchgroup=ocamlModule start="\<sig\>" matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule +syn region   ocamlModSpec matchgroup=ocamlKeyword start="\<module\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contained contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlModTRWith,ocamlMPRestr + +" "open" +syn region   ocamlNone matchgroup=ocamlKeyword start="\<open\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\(\.\u\(\w\|'\)*\)*\>" contains=@ocamlAllErrs,ocamlComment + +" "include" +syn match    ocamlKeyword "\<include\>" skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod + +" "module" - somewhat complicated stuff ;-) +syn region   ocamlModule matchgroup=ocamlKeyword start="\<module\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlPreDef +syn region   ocamlPreDef start="."me=e-1 matchgroup=ocamlKeyword end="\l\|=\|)"me=e-1 contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam,ocamlModTypeRestr,ocamlModTRWith nextgroup=ocamlModPreRHS +syn region   ocamlModParam start="([^*]" end=")" contained contains=@ocamlAENoParen,ocamlModParam1,ocamlVal +syn match    ocamlModParam1 "\<\u\(\w\|'\)*\>" contained skipwhite skipempty nextgroup=ocamlPreMPRestr + +syn region   ocamlPreMPRestr start="."me=e-1 end=")"me=e-1 contained contains=@ocamlAllErrs,ocamlComment,ocamlMPRestr,ocamlModTypeRestr + +syn region   ocamlMPRestr start=":" end="."me=e-1 contained contains=@ocamlComment skipwhite skipempty nextgroup=ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3 +syn region   ocamlMPRestr1 matchgroup=ocamlModule start="\ssig\s\=" matchgroup=ocamlModule end="\<end\>" contained contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule +syn region   ocamlMPRestr2 start="\sfunctor\(\s\|(\)\="me=e-1 matchgroup=ocamlKeyword end="->" contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam skipwhite skipempty nextgroup=ocamlFuncWith,ocamlMPRestr2 +syn match    ocamlMPRestr3 "\w\(\w\|'\)*\(\.\w\(\w\|'\)*\)*" contained +syn match    ocamlModPreRHS "=" contained skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod +syn keyword  ocamlKeyword val +syn region   ocamlVal matchgroup=ocamlKeyword start="\<val\>" matchgroup=ocamlLCIdentifier end="\<\l\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlMPRestr +syn region   ocamlModRHS start="." end=".\w\|([^*]"me=e-2 contained contains=ocamlComment skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod +syn match    ocamlFullMod "\<\u\(\w\|'\)*\(\.\u\(\w\|'\)*\)*" contained skipwhite skipempty nextgroup=ocamlFuncWith + +syn region   ocamlFuncWith start="([^*]"me=e-1 end=")" contained contains=ocamlComment,ocamlWith,ocamlFuncStruct skipwhite skipempty nextgroup=ocamlFuncWith +syn region   ocamlFuncStruct matchgroup=ocamlModule start="[^a-zA-Z]struct\>"hs=s+1 matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr + +syn match    ocamlModTypeRestr "\<\w\(\w\|'\)*\(\.\w\(\w\|'\)*\)*\>" contained +syn region   ocamlModTRWith start=":\s*("hs=s+1 end=")" contained contains=@ocamlAENoParen,ocamlWith +syn match    ocamlWith "\<\(\u\(\w\|'\)*\.\)*\w\(\w\|'\)*\>" contained skipwhite skipempty nextgroup=ocamlWithRest +syn region   ocamlWithRest start="[^)]" end=")"me=e-1 contained contains=ALLBUT,@ocamlContained + +" "struct" +syn region   ocamlStruct matchgroup=ocamlModule start="\<\(module\s\+\)\=struct\>" matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr + +" "module type" +syn region   ocamlKeyword start="\<module\>\s*\<type\>\(\s*\<of\>\)\=" matchgroup=ocamlModule end="\<\w\(\w\|'\)*\>" contains=ocamlComment skipwhite skipempty nextgroup=ocamlMTDef +syn match    ocamlMTDef "=\s*\w\(\w\|'\)*\>"hs=s+1,me=s + +syn keyword  ocamlKeyword  and as assert class +syn keyword  ocamlKeyword  constraint else +syn keyword  ocamlKeyword  exception external fun + +syn keyword  ocamlKeyword  in inherit initializer +syn keyword  ocamlKeyword  land lazy let match +syn keyword  ocamlKeyword  method mutable new of +syn keyword  ocamlKeyword  parser private raise rec +syn keyword  ocamlKeyword  try type +syn keyword  ocamlKeyword  virtual when while with + +if exists("ocaml_revised") +  syn keyword  ocamlKeyword  do value +  syn keyword  ocamlBoolean  True False +else +  syn keyword  ocamlKeyword  function +  syn keyword  ocamlBoolean  true false +  syn match    ocamlKeyChar  "!" +endif + +syn keyword  ocamlType     array bool char exn float format format4 +syn keyword  ocamlType     int int32 int64 lazy_t list nativeint option +syn keyword  ocamlType     string unit + +syn keyword  ocamlOperator asr lnot lor lsl lsr lxor mod not + +syn match    ocamlConstructor  "(\s*)" +syn match    ocamlConstructor  "\[\s*\]" +syn match    ocamlConstructor  "\[|\s*>|]" +syn match    ocamlConstructor  "\[<\s*>\]" +syn match    ocamlConstructor  "\u\(\w\|'\)*\>" + +" Polymorphic variants +syn match    ocamlConstructor  "`\w\(\w\|'\)*\>" + +" Module prefix +syn match    ocamlModPath      "\u\(\w\|'\)*\."he=e-1 + +syn match    ocamlCharacter    "'\\\d\d\d'\|'\\[\'ntbr]'\|'.'" +syn match    ocamlCharacter    "'\\x\x\x'" +syn match    ocamlCharErr      "'\\\d\d'\|'\\\d'" +syn match    ocamlCharErr      "'\\[^\'ntbr]'" +syn region   ocamlString       start=+"+ skip=+\\\\\|\\"+ end=+"+ + +syn match    ocamlFunDef       "->" +syn match    ocamlRefAssign    ":=" +syn match    ocamlTopStop      ";;" +syn match    ocamlOperator     "\^" +syn match    ocamlOperator     "::" + +syn match    ocamlOperator     "&&" +syn match    ocamlOperator     "<" +syn match    ocamlOperator     ">" +syn match    ocamlAnyVar       "\<_\>" +syn match    ocamlKeyChar      "|[^\]]"me=e-1 +syn match    ocamlKeyChar      ";" +syn match    ocamlKeyChar      "\~" +syn match    ocamlKeyChar      "?" +syn match    ocamlKeyChar      "\*" +syn match    ocamlKeyChar      "=" + +if exists("ocaml_revised") +  syn match    ocamlErr        "<-" +else +  syn match    ocamlOperator   "<-" +endif + +syn match    ocamlNumber        "\<-\=\d\(_\|\d\)*[l|L|n]\?\>" +syn match    ocamlNumber        "\<-\=0[x|X]\(\x\|_\)\+[l|L|n]\?\>" +syn match    ocamlNumber        "\<-\=0[o|O]\(\o\|_\)\+[l|L|n]\?\>" +syn match    ocamlNumber        "\<-\=0[b|B]\([01]\|_\)\+[l|L|n]\?\>" +syn match    ocamlFloat         "\<-\=\d\(_\|\d\)*\.\?\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)\=\>" + +" Labels +syn match    ocamlLabel        "\~\(\l\|_\)\(\w\|'\)*"lc=1 +syn match    ocamlLabel        "?\(\l\|_\)\(\w\|'\)*"lc=1 +syn region   ocamlLabel transparent matchgroup=ocamlLabel start="?(\(\l\|_\)\(\w\|'\)*"lc=2 end=")"me=e-1 contains=ALLBUT,@ocamlContained,ocamlParenErr + + +" Synchronization +syn sync minlines=50 +syn sync maxlines=500 + +if !exists("ocaml_revised") +  syn sync match ocamlDoSync      grouphere  ocamlDo      "\<do\>" +  syn sync match ocamlDoSync      groupthere ocamlDo      "\<done\>" +endif + +if exists("ocaml_revised") +  syn sync match ocamlEndSync     grouphere  ocamlEnd     "\<\(object\)\>" +else +  syn sync match ocamlEndSync     grouphere  ocamlEnd     "\<\(begin\|object\)\>" +endif + +syn sync match ocamlEndSync     groupthere ocamlEnd     "\<end\>" +syn sync match ocamlStructSync  grouphere  ocamlStruct  "\<struct\>" +syn sync match ocamlStructSync  groupthere ocamlStruct  "\<end\>" +syn sync match ocamlSigSync     grouphere  ocamlSig     "\<sig\>" +syn sync match ocamlSigSync     groupthere ocamlSig     "\<end\>" + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_ocaml_syntax_inits") +  if version < 508 +    let did_ocaml_syntax_inits = 1 +    command -nargs=+ HiLink hi link <args> +  else +    command -nargs=+ HiLink hi def link <args> +  endif + +  HiLink ocamlBraceErr	   Error +  HiLink ocamlBrackErr	   Error +  HiLink ocamlParenErr	   Error +  HiLink ocamlArrErr	   Error + +  HiLink ocamlCommentErr   Error + +  HiLink ocamlCountErr	   Error +  HiLink ocamlDoErr	   Error +  HiLink ocamlDoneErr	   Error +  HiLink ocamlEndErr	   Error +  HiLink ocamlThenErr	   Error + +  HiLink ocamlCharErr	   Error + +  HiLink ocamlErr	   Error + +  HiLink ocamlComment	   Comment + +  HiLink ocamlModPath	   Include +  HiLink ocamlObject	   Include +  HiLink ocamlModule	   Include +  HiLink ocamlModParam1    Include +  HiLink ocamlModType	   Include +  HiLink ocamlMPRestr3	   Include +  HiLink ocamlFullMod	   Include +  HiLink ocamlModTypeRestr Include +  HiLink ocamlWith	   Include +  HiLink ocamlMTDef	   Include + +  HiLink ocamlScript	   Include + +  HiLink ocamlConstructor  Constant + +  HiLink ocamlVal          Keyword +  HiLink ocamlModPreRHS    Keyword +  HiLink ocamlMPRestr2	   Keyword +  HiLink ocamlKeyword	   Keyword +  HiLink ocamlMethod	   Include +  HiLink ocamlFunDef	   Keyword +  HiLink ocamlRefAssign    Keyword +  HiLink ocamlKeyChar	   Keyword +  HiLink ocamlAnyVar	   Keyword +  HiLink ocamlTopStop	   Keyword +  HiLink ocamlOperator	   Keyword + +  HiLink ocamlBoolean	   Boolean +  HiLink ocamlCharacter    Character +  HiLink ocamlNumber	   Number +  HiLink ocamlFloat	   Float +  HiLink ocamlString	   String + +  HiLink ocamlLabel	   Identifier + +  HiLink ocamlType	   Type + +  HiLink ocamlTodo	   Todo + +  HiLink ocamlEncl	   Keyword + +  delcommand HiLink +endif + +let b:current_syntax = "ocaml" + +" vim: ts=8 diff --git a/syntax/ruby.vim b/syntax/ruby.vim new file mode 100644 index 00000000..08f71554 --- /dev/null +++ b/syntax/ruby.vim @@ -0,0 +1,369 @@ +" Vim syntax file +" Language:		Ruby +" Maintainer:		Doug Kearns <dougkearns@gmail.com> +" URL:			https://github.com/vim-ruby/vim-ruby +" Release Coordinator:	Doug Kearns <dougkearns@gmail.com> +" ---------------------------------------------------------------------------- +" +" Previous Maintainer:	Mirko Nasato +" Thanks to perl.vim authors, and to Reimer Behrends. :-) (MN) +" ---------------------------------------------------------------------------- + +if exists("b:current_syntax") +  finish +endif + +if has("folding") && exists("ruby_fold") +  setlocal foldmethod=syntax +endif + +syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo + +if exists("ruby_space_errors") +  if !exists("ruby_no_trail_space_error") +    syn match rubySpaceError display excludenl "\s\+$" +  endif +  if !exists("ruby_no_tab_space_error") +    syn match rubySpaceError display " \+\t"me=e-1 +  endif +endif + +" Operators +if exists("ruby_operators") +  syn match  rubyOperator "[~!^&|*/%+-]\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::" +  syn match  rubyOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=" +  syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop +endif + +" Expression Substitution and Backslash Notation +syn match rubyStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}"						    contained display +syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display +syn match rubyQuoteEscape  "\\[\\']"											    contained display + +syn region rubyInterpolation	      matchgroup=rubyInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,@rubyNotTop +syn match  rubyInterpolation	      "#\%(\$\|@@\=\)\w\+"    display contained contains=rubyInterpolationDelimiter,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable,rubyPredefinedVariable +syn match  rubyInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained +syn match  rubyInterpolation	      "#\$\%(-\w\|\W\)"       display contained contains=rubyInterpolationDelimiter,rubyPredefinedVariable,rubyInvalidVariable +syn match  rubyInterpolationDelimiter "#\ze\$\%(-\w\|\W\)"    display contained +syn region rubyNoInterpolation	      start="\\#{" end="}"            contained +syn match  rubyNoInterpolation	      "\\#{"		      display contained +syn match  rubyNoInterpolation	      "\\#\%(\$\|@@\=\)\w\+"  display contained +syn match  rubyNoInterpolation	      "\\#\$\W"		      display contained + +syn match rubyDelimEscape	"\\[(<{\[)>}\]]" transparent display contained contains=NONE + +syn region rubyNestedParentheses    start="("  skip="\\\\\|\\)"  matchgroup=rubyString end=")"	transparent contained +syn region rubyNestedCurlyBraces    start="{"  skip="\\\\\|\\}"  matchgroup=rubyString end="}"	transparent contained +syn region rubyNestedAngleBrackets  start="<"  skip="\\\\\|\\>"  matchgroup=rubyString end=">"	transparent contained +syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]"	transparent contained + +" These are mostly Oniguruma ready +syn region rubyRegexpComment	matchgroup=rubyRegexpSpecial   start="(?#"								  skip="\\)"  end=")"  contained +syn region rubyRegexpParens	matchgroup=rubyRegexpSpecial   start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\)"  end=")"  contained transparent contains=@rubyRegexpSpecial +syn region rubyRegexpBrackets	matchgroup=rubyRegexpCharClass start="\[\^\="								  skip="\\\]" end="\]" contained transparent contains=rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass oneline +syn match  rubyRegexpCharClass	"\\[DdHhSsWw]"	       contained display +syn match  rubyRegexpCharClass	"\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\):\]" contained +syn match  rubyRegexpEscape	"\\[].*?+^$|\\/(){}[]" contained +syn match  rubyRegexpQuantifier	"[*?+][?+]\="	       contained display +syn match  rubyRegexpQuantifier	"{\d\+\%(,\d*\)\=}?\=" contained display +syn match  rubyRegexpAnchor	"[$^]\|\\[ABbGZz]"     contained display +syn match  rubyRegexpDot	"\."		       contained display +syn match  rubyRegexpSpecial	"|"		       contained display +syn match  rubyRegexpSpecial	"\\[1-9]\d\=\d\@!"     contained display +syn match  rubyRegexpSpecial	"\\k<\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\=>" contained display +syn match  rubyRegexpSpecial	"\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" contained display +syn match  rubyRegexpSpecial	"\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display +syn match  rubyRegexpSpecial	"\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display + +syn cluster rubyStringSpecial	      contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape +syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets +syn cluster rubyRegexpSpecial	      contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment + +" Numbers and ASCII Codes +syn match rubyASCIICode	"\%(\w\|[]})\"'/]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)" +syn match rubyInteger	"\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*\>"								display +syn match rubyInteger	"\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)\>"						display +syn match rubyInteger	"\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*\>"								display +syn match rubyInteger	"\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)*\>"								display +syn match rubyFloat	"\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*\>"					display +syn match rubyFloat	"\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)\>"	display + +" Identifiers +syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent +syn match rubyBlockArgument	    "&[_[:lower:]][_[:alnum:]]"		 contains=NONE display transparent + +syn match  rubyConstant		"\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" +syn match  rubyClassVariable	"@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display +syn match  rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*"  display +syn match  rubyGlobalVariable	"$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)" +syn match  rubySymbol		"[]})\"':]\@<!:\%(\^\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" +syn match  rubySymbol		"[]})\"':]\@<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)" +syn match  rubySymbol		"[]})\"':]\@<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" +syn match  rubySymbol		"[]})\"':]\@<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\=" +syn match  rubySymbol		"\%([{(,]\_s*\)\@<=\l\w*[!?]\=::\@!"he=e-1 +syn match  rubySymbol		"[]})\"':]\@<!\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:\s\@="he=e-1 +syn match  rubySymbol		"\%([{(,]\_s*\)\@<=[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1 +syn match  rubySymbol		"[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:\s\@="hs=s+1,he=e-1 +syn region rubySymbol		start="[]})\"':]\@<!:'"  end="'"  skip="\\\\\|\\'"  contains=rubyQuoteEscape fold +syn region rubySymbol		start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold + +syn match  rubyBlockParameter	  "\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contained +syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\s*\)\@<=|" end="|" oneline display contains=rubyBlockParameter + +syn match rubyInvalidVariable	 "$[^ A-Za-z_-]" +syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~]# +syn match rubyPredefinedVariable "$\d\+"										   display +syn match rubyPredefinedVariable "$_\>"											   display +syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>"									   display +syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>"					   display +syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display +syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(ARGF\|ARGV\|ENV\|DATA\|FALSE\|NIL\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>\%(\s*(\)\@!" +syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(RUBY_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!" + +" Normal Regular Expression +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold + +" Generalized Regular Expression +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{"				 end="}[iomxneus]*"   skip="\\\\\|\\}"	 contains=@rubyRegexpSpecial fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<"				 end=">[iomxneus]*"   skip="\\\\\|\\>"	 contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\["				 end="\][iomxneus]*"  skip="\\\\\|\\\]"	 contains=@rubyRegexpSpecial fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r("				 end=")[iomxneus]*"   skip="\\\\\|\\)"	 contains=@rubyRegexpSpecial fold + +" Normal String and Shell Command Output +syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold +syn region rubyString matchgroup=rubyStringDelimiter start="'"	end="'"  skip="\\\\\|\\'"  contains=rubyQuoteEscape,@Spell    fold +syn region rubyString matchgroup=rubyStringDelimiter start="`"	end="`"  skip="\\\\\|\\`"  contains=@rubyStringSpecial fold + +" Generalized Single Quoted String, Symbol and Array of Strings +syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]{"				   end="}"   skip="\\\\\|\\}"	fold contains=rubyNestedCurlyBraces,rubyDelimEscape +syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]<"				   end=">"   skip="\\\\\|\\>"	fold contains=rubyNestedAngleBrackets,rubyDelimEscape +syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]\["				   end="\]"  skip="\\\\\|\\\]"	fold contains=rubyNestedSquareBrackets,rubyDelimEscape +syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]("				   end=")"   skip="\\\\\|\\)"	fold contains=rubyNestedParentheses,rubyDelimEscape +syn region rubyString matchgroup=rubyStringDelimiter start="%q "				   end=" "   skip="\\\\\|\\)"	fold +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)"   end="\z1" skip="\\\\\|\\\z1" fold +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{"				   end="}"   skip="\\\\\|\\}"	fold contains=rubyNestedCurlyBraces,rubyDelimEscape +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<"				   end=">"   skip="\\\\\|\\>"	fold contains=rubyNestedAngleBrackets,rubyDelimEscape +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\["				   end="\]"  skip="\\\\\|\\\]"	fold contains=rubyNestedSquareBrackets,rubyDelimEscape +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s("				   end=")"   skip="\\\\\|\\)"	fold contains=rubyNestedParentheses,rubyDelimEscape + +" Generalized Double Quoted String and Array of Strings and Shell Command Output +" Note: %= is not matched here as the beginning of a double quoted string +syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)"	    end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\={"				    end="}"   skip="\\\\\|\\}"	 contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape    fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=<"				    end=">"   skip="\\\\\|\\>"	 contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape  fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=\["				    end="\]"  skip="\\\\\|\\\]"	 contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=("				    end=")"   skip="\\\\\|\\)"	 contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape    fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx] "				    end=" "   skip="\\\\\|\\)"   contains=@rubyStringSpecial fold + +" Here Document +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+	 end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop + +syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+2	matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend +syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+2	matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend +syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+2	matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc			fold keepend +syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+2	matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend + +syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3    matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend +syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-"\z([^"]*\)"\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3  matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend +syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-'\z([^']*\)'\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3  matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart		     fold keepend +syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-`\z([^`]*\)`\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3  matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend + +if exists('main_syntax') && main_syntax == 'eruby' +  let b:ruby_no_expensive = 1 +end + +syn match  rubyAliasDeclaration    "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable nextgroup=rubyAliasDeclaration2 skipwhite +syn match  rubyAliasDeclaration2   "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable +syn match  rubyMethodDeclaration   "[^[:space:];#(]\+"	 contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable +syn match  rubyClassDeclaration    "[^[:space:];#<]\+"	 contained contains=rubyConstant,rubyOperator +syn match  rubyModuleDeclaration   "[^[:space:];#<]\+"	 contained contains=rubyConstant,rubyOperator +syn match  rubyFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=rubyMethodDeclaration +syn match  rubyFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2 +syn match  rubyFunction "\%([[:space:].]\|^\)\@<=\%(\[\]=\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration + +syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter + +" Keywords +" Note: the following keywords have already been defined: +" begin case class def do end for if module unless until while +syn match   rubyControl	       "\<\%(and\|break\|in\|next\|not\|or\|redo\|rescue\|retry\|return\)\>[?!]\@!" +syn match   rubyOperator       "\<defined?" display +syn match   rubyKeyword	       "\<\%(super\|yield\)\>[?!]\@!" +syn match   rubyBoolean	       "\<\%(true\|false\)\>[?!]\@!" +syn match   rubyPseudoVariable "\<\%(nil\|self\|__ENCODING__\|__FILE__\|__LINE__\|__callee__\|__method__\)\>[?!]\@!" " TODO: reorganise +syn match   rubyBeginEnd       "\<\%(BEGIN\|END\)\>[?!]\@!" + +" Expensive Mode - match 'end' with the appropriate opening keyword for syntax +" based folding and special highlighting of module/class/method definitions +if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") +  syn match  rubyDefine "\<alias\>"  nextgroup=rubyAliasDeclaration  skipwhite skipnl +  syn match  rubyDefine "\<def\>"    nextgroup=rubyMethodDeclaration skipwhite skipnl +  syn match  rubyDefine "\<undef\>"  nextgroup=rubyFunction	     skipwhite skipnl +  syn match  rubyClass	"\<class\>"  nextgroup=rubyClassDeclaration  skipwhite skipnl +  syn match  rubyModule "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl + +  syn region rubyMethodBlock start="\<def\>"	matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold +  syn region rubyBlock	     start="\<class\>"	matchgroup=rubyClass  end="\<end\>"		       contains=ALLBUT,@rubyNotTop fold +  syn region rubyBlock	     start="\<module\>" matchgroup=rubyModule end="\<end\>"		       contains=ALLBUT,@rubyNotTop fold + +  " modifiers +  syn match rubyConditionalModifier "\<\%(if\|unless\)\>"    display +  syn match rubyRepeatModifier	     "\<\%(while\|until\)\>" display + +  syn region rubyDoBlock      matchgroup=rubyControl start="\<do\>" end="\<end\>"                 contains=ALLBUT,@rubyNotTop fold +  " curly bracket block or hash literal +  syn region rubyCurlyBlock	matchgroup=rubyCurlyBlockDelimiter  start="{" end="}"				contains=ALLBUT,@rubyNotTop fold +  syn region rubyArrayLiteral	matchgroup=rubyArrayDelimiter	    start="\%(\w\|[\]})]\)\@<!\[" end="]"	contains=ALLBUT,@rubyNotTop fold + +  " statements without 'do' +  syn region rubyBlockExpression       matchgroup=rubyControl	  start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold +  syn region rubyCaseExpression	       matchgroup=rubyConditional start="\<case\>"  end="\<end\>" contains=ALLBUT,@rubyNotTop fold +  syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold + +  syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!"	contained containedin=rubyCaseExpression +  syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression + +  syn match rubyExceptional	  "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyBlockExpression +  syn match rubyMethodExceptional "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyMethodBlock + +  " statements with optional 'do' +  syn region rubyOptionalDoLine   matchgroup=rubyRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop +  syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine fold + +  if !exists("ruby_minlines") +    let ruby_minlines = 500 +  endif +  exec "syn sync minlines=" . ruby_minlines + +else +  syn match rubyControl "\<def\>[?!]\@!"    nextgroup=rubyMethodDeclaration skipwhite skipnl +  syn match rubyControl "\<class\>[?!]\@!"  nextgroup=rubyClassDeclaration  skipwhite skipnl +  syn match rubyControl "\<module\>[?!]\@!" nextgroup=rubyModuleDeclaration skipwhite skipnl +  syn match rubyControl "\<\%(case\|begin\|do\|for\|if\|unless\|while\|until\|else\|elsif\|ensure\|then\|when\|end\)\>[?!]\@!" +  syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!" +endif + +" Special Methods +if !exists("ruby_no_special_methods") +  syn keyword rubyAccess    public protected private public_class_method private_class_method public_constant private_constant module_function +  " attr is a common variable name +  syn match   rubyAttribute "\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!" +  syn keyword rubyAttribute attr_accessor attr_reader attr_writer +  syn match   rubyControl   "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>[?!]\@!\)" +  syn keyword rubyEval	    eval class_eval instance_eval module_eval +  syn keyword rubyException raise fail catch throw +  " false positive with 'include?' +  syn match   rubyInclude   "\<include\>[?!]\@!" +  syn keyword rubyInclude   autoload extend load prepend require require_relative +  syn keyword rubyKeyword   callcc caller lambda proc +endif + +" Comments and Documentation +syn match   rubySharpBang "\%^#!.*" display +syn keyword rubyTodo	  FIXME NOTE TODO OPTIMIZE XXX todo contained +syn match   rubyComment   "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell +if !exists("ruby_no_comment_fold") +  syn region rubyMultilineComment start="\%(\%(^\s*#.*\n\)\@<!\%(^\s*#.*\n\)\)\%(\(^\s*#.*\n\)\{1,}\)\@=" end="\%(^\s*#.*\n\)\@<=\%(^\s*#.*\n\)\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend +  syn region rubyDocumentation	  start="^=begin\ze\%(\s.*\)\=$" end="^=end\%(\s.*\)\=$" contains=rubySpaceError,rubyTodo,@Spell fold +else +  syn region rubyDocumentation	  start="^=begin\s*$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell +endif + +" Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver +syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(alias\|and\|begin\|break\|case\|class\|def\|defined\|do\|else\)\>"		  transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(elsif\|end\|ensure\|false\|for\|if\|in\|module\|next\|nil\)\>"		  transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(not\|or\|redo\|rescue\|retry\|return\|self\|super\|then\|true\)\>"		  transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(undef\|unless\|until\|when\|while\|yield\|BEGIN\|END\|__FILE__\|__LINE__\)\>" transparent contains=NONE + +syn match rubyKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)[?!]" transparent contains=NONE +syn match rubyKeywordAsMethod "\<\%(if\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE + +syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(abort\|at_exit\|attr\|attr_accessor\|attr_reader\)\>"	transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(attr_writer\|autoload\|callcc\|catch\|caller\)\>"		transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(eval\|class_eval\|instance_eval\|module_eval\|exit\)\>"	transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fail\|fork\|include\|lambda\)\>"			transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(load\|loop\|prepend\|private\|proc\|protected\)\>"		transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(public\|require\|require_relative\|raise\|throw\|trap\)\>"	transparent contains=NONE + +" __END__ Directive +syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold + +hi def link rubyClass			rubyDefine +hi def link rubyModule			rubyDefine +hi def link rubyMethodExceptional	rubyDefine +hi def link rubyDefine			Define +hi def link rubyFunction		Function +hi def link rubyConditional		Conditional +hi def link rubyConditionalModifier	rubyConditional +hi def link rubyExceptional		rubyConditional +hi def link rubyRepeat			Repeat +hi def link rubyRepeatModifier		rubyRepeat +hi def link rubyOptionalDo		rubyRepeat +hi def link rubyControl			Statement +hi def link rubyInclude			Include +hi def link rubyInteger			Number +hi def link rubyASCIICode		Character +hi def link rubyFloat			Float +hi def link rubyBoolean			Boolean +hi def link rubyException		Exception +if !exists("ruby_no_identifiers") +  hi def link rubyIdentifier		Identifier +else +  hi def link rubyIdentifier		NONE +endif +hi def link rubyClassVariable		rubyIdentifier +hi def link rubyConstant		Type +hi def link rubyGlobalVariable		rubyIdentifier +hi def link rubyBlockParameter		rubyIdentifier +hi def link rubyInstanceVariable	rubyIdentifier +hi def link rubyPredefinedIdentifier	rubyIdentifier +hi def link rubyPredefinedConstant	rubyPredefinedIdentifier +hi def link rubyPredefinedVariable	rubyPredefinedIdentifier +hi def link rubySymbol			Constant +hi def link rubyKeyword			Keyword +hi def link rubyOperator		Operator +hi def link rubyBeginEnd		Statement +hi def link rubyAccess			Statement +hi def link rubyAttribute		Statement +hi def link rubyEval			Statement +hi def link rubyPseudoVariable		Constant + +hi def link rubyComment			Comment +hi def link rubyData			Comment +hi def link rubyDataDirective		Delimiter +hi def link rubyDocumentation		Comment +hi def link rubyTodo			Todo + +hi def link rubyQuoteEscape		rubyStringEscape +hi def link rubyStringEscape		Special +hi def link rubyInterpolationDelimiter	Delimiter +hi def link rubyNoInterpolation		rubyString +hi def link rubySharpBang		PreProc +hi def link rubyRegexpDelimiter		rubyStringDelimiter +hi def link rubySymbolDelimiter		rubyStringDelimiter +hi def link rubyStringDelimiter		Delimiter +hi def link rubyHeredoc			rubyString +hi def link rubyString			String +hi def link rubyRegexpEscape		rubyRegexpSpecial +hi def link rubyRegexpQuantifier	rubyRegexpSpecial +hi def link rubyRegexpAnchor		rubyRegexpSpecial +hi def link rubyRegexpDot		rubyRegexpCharClass +hi def link rubyRegexpCharClass		rubyRegexpSpecial +hi def link rubyRegexpSpecial		Special +hi def link rubyRegexpComment		Comment +hi def link rubyRegexp			rubyString + +hi def link rubyInvalidVariable		Error +hi def link rubyError			Error +hi def link rubySpaceError		rubyError + +let b:current_syntax = "ruby" + +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/syntax/sass.vim b/syntax/sass.vim new file mode 100644 index 00000000..d8f6b781 --- /dev/null +++ b/syntax/sass.vim @@ -0,0 +1,100 @@ +" Vim syntax file +" Language:	Sass +" Maintainer:	Tim Pope <vimNOSPAM@tpope.org> +" Filenames:	*.sass +" Last Change:	2010 Aug 09 + +if exists("b:current_syntax") +  finish +endif + +runtime! syntax/css.vim + +syn case ignore + +syn cluster sassCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp +syn cluster sassCssAttributes contains=css.*Attr,sassEndOfLineComment,scssComment,cssValue.*,cssColor,cssURL,sassDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp + +syn region sassDefinition matchgroup=cssBraces start="{" end="}" contains=TOP + +syn match sassProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:" contains=css.*Prop skipwhite nextgroup=sassCssAttribute contained containedin=sassDefinition +syn match sassProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute +syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute +syn match sassCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@sassCssAttributes,sassVariable,sassFunction,sassInterpolation +syn match sassDefault "!default\>" contained +syn match sassVariable "!\%(important\>\|default\>\)\@![[:alnum:]_-]\+" +syn match sassVariable "$[[:alnum:]_-]\+" +syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=\%(||\)\==" nextgroup=sassCssAttribute skipwhite +syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=:" nextgroup=sassCssAttribute skipwhite + +syn match sassFunction "\<\%(rgb\|rgba\|red\|green\|blue\|mix\)\>(\@=" contained +syn match sassFunction "\<\%(hsl\|hsla\|hue\|saturation\|lightness\|adjust-hue\|lighten\|darken\|saturate\|desaturate\|grayscale\|complement\)\>(\@=" contained +syn match sassFunction "\<\%(alpha\|opacity\|rgba\|opacify\|fade-in\|transparentize\|fade-out\)\>(\@=" contained +syn match sassFunction "\<\%(unquote\|quote\)\>(\@=" contained +syn match sassFunction "\<\%(percentage\|round\|ceil\|floor\|abs\)\>(\@=" contained +syn match sassFunction "\<\%(type-of\|unit\|unitless\|comparable\)\>(\@=" contained + +syn region sassInterpolation matchgroup=sassInterpolationDelimiter start="#{" end="}" contains=@sassCssAttributes,sassVariable,sassFunction containedin=cssStringQ,cssStringQQ,cssPseudoClass,sassProperty + +syn match sassMixinName "[[:alnum:]_-]\+" contained nextgroup=sassCssAttribute +syn match sassMixin  "^="               nextgroup=sassMixinName skipwhite +syn match sassMixin  "\%([{};]\s*\|^\s*\)\@<=@mixin"   nextgroup=sassMixinName skipwhite +syn match sassMixing "^\s\+\zs+"        nextgroup=sassMixinName +syn match sassMixing "\%([{};]\s*\|^\s*\)\@<=@include" nextgroup=sassMixinName skipwhite +syn match sassExtend "\%([{};]\s*\|^\s*\)\@<=@extend" +syn match sassPlaceholder "\%([{};]\s*\|^\s*\)\@<=%"   nextgroup=sassMixinName skipwhite + +syn match sassFunctionName "[[:alnum:]_-]\+" contained nextgroup=sassCssAttribute +syn match sassFunctionDecl "\%([{};]\s*\|^\s*\)\@<=@function"   nextgroup=sassFunctionName skipwhite +syn match sassReturn "\%([{};]\s*\|^\s*\)\@<=@return" + +syn match sassEscape     "^\s*\zs\\" +syn match sassIdChar     "#[[:alnum:]_-]\@=" nextgroup=sassId +syn match sassId         "[[:alnum:]_-]\+" contained +syn match sassClassChar  "\.[[:alnum:]_-]\@=" nextgroup=sassClass +syn match sassClass      "[[:alnum:]_-]\+" contained +syn match sassAmpersand  "&" + +" TODO: Attribute namespaces +" TODO: Arithmetic (including strings and concatenation) + +syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssStringQ,cssStringQQ,cssURL,cssUnicodeEscape,cssMediaType +syn region sassDebugLine end=";\|$" matchgroup=sassDebug start="@debug\>" contains=@sassCssAttributes,sassVariable,sassFunction +syn region sassWarnLine end=";\|$" matchgroup=sassWarn start="@warn\>" contains=@sassCssAttributes,sassVariable,sassFunction +syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\|each\)\>" end="[{};]\@=\|$" contains=sassFor,@sassCssAttributes,sassVariable,sassFunction +syn keyword sassFor from to through in contained + +syn keyword sassTodo        FIXME NOTE TODO OPTIMIZE XXX contained +syn region  sassComment     start="^\z(\s*\)//"  end="^\%(\z1 \)\@!" contains=sassTodo,@Spell +syn region  sassCssComment  start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell +syn match   sassEndOfLineComment "//.*" contains=sassComment,sassTodo,@Spell + +hi def link sassEndOfLineComment        sassComment +hi def link sassCssComment              sassComment +hi def link sassComment                 Comment +hi def link sassDefault                 cssImportant +hi def link sassVariable                Identifier +hi def link sassFunction                Function +hi def link sassMixing                  PreProc +hi def link sassMixin                   PreProc +hi def link sassPlaceholder             PreProc +hi def link sassExtend                  PreProc +hi def link sassFunctionDecl            PreProc +hi def link sassReturn                  PreProc +hi def link sassTodo                    Todo +hi def link sassInclude                 Include +hi def link sassDebug                   sassControl +hi def link sassWarn                    sassControl +hi def link sassControl                 PreProc +hi def link sassFor                     PreProc +hi def link sassEscape                  Special +hi def link sassIdChar                  Special +hi def link sassClassChar               Special +hi def link sassInterpolationDelimiter  Delimiter +hi def link sassAmpersand               Character +hi def link sassId                      Identifier +hi def link sassClass                   Type + +let b:current_syntax = "sass" + +" vim:set sw=2: diff --git a/syntax/scss.vim b/syntax/scss.vim new file mode 100644 index 00000000..6fb96915 --- /dev/null +++ b/syntax/scss.vim @@ -0,0 +1,20 @@ +" Vim syntax file +" Language:	SCSS +" Maintainer:	Tim Pope <vimNOSPAM@tpope.org> +" Filenames:	*.scss +" Last Change:	2010 Jul 26 + +if exists("b:current_syntax") +  finish +endif + +runtime! syntax/sass.vim + +syn match scssComment "//.*" contains=sassTodo,@Spell +syn region scssComment start="/\*" end="\*/" contains=sassTodo,@Spell + +hi def link scssComment sassComment + +let b:current_syntax = "scss" + +" vim:set sw=2: diff --git a/syntax/slim.vim b/syntax/slim.vim new file mode 100644 index 00000000..c4371b10 --- /dev/null +++ b/syntax/slim.vim @@ -0,0 +1,98 @@ +" Vim syntax file +" Language: Slim +" Maintainer: Andrew Stone <andy@stonean.com> +" Version:  1 +" Last Change:  2010 Sep 25 +" TODO: Feedback is welcomed. + +" Quit when a syntax file is already loaded. +if exists("b:current_syntax") +  finish +endif + +if !exists("main_syntax") +  let main_syntax = 'slim' +endif + +" Allows a per line syntax evaluation. +let b:ruby_no_expensive = 1 + +" Include Ruby syntax highlighting +syn include @slimRubyTop syntax/ruby.vim +unlet! b:current_syntax +" Include Haml syntax highlighting +syn include @slimHaml syntax/haml.vim +unlet! b:current_syntax + +syn match slimBegin  "^\s*\(&[^= ]\)\@!" nextgroup=slimTag,slimClassChar,slimIdChar,slimRuby + +syn region  rubyCurlyBlock start="{" end="}" contains=@slimRubyTop contained +syn cluster slimRubyTop    add=rubyCurlyBlock + +syn cluster slimComponent contains=slimClassChar,slimIdChar,slimWrappedAttrs,slimRuby,slimAttr,slimInlineTagChar + +syn keyword slimDocType        contained html 5 1.1 strict frameset mobile basic transitional +syn match   slimDocTypeKeyword "^\s*\(doctype\)\s\+" nextgroup=slimDocType + +syn keyword slimTodo        FIXME TODO NOTE OPTIMIZE XXX contained + +syn match slimTag           "\w\+"         contained contains=htmlTagName nextgroup=@slimComponent +syn match slimIdChar        "#{\@!"        contained nextgroup=slimId +syn match slimId            "\%(\w\|-\)\+" contained nextgroup=@slimComponent +syn match slimClassChar     "\."           contained nextgroup=slimClass +syn match slimClass         "\%(\w\|-\)\+" contained nextgroup=@slimComponent +syn match slimInlineTagChar "\s*:\s*"      contained nextgroup=slimTag,slimClassChar,slimIdChar + +syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*{\s*" skip="}\s*\""  end="\s*}\s*"  contained contains=slimAttr nextgroup=slimRuby +syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*\[\s*" end="\s*\]\s*" contained contains=slimAttr nextgroup=slimRuby +syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*(\s*"  end="\s*)\s*"  contained contains=slimAttr nextgroup=slimRuby + +syn match slimAttr "\s*\%(\w\|-\)\+\s*" contained contains=htmlArg nextgroup=slimAttrAssignment +syn match slimAttrAssignment "\s*=\s*" contained nextgroup=slimWrappedAttrValue,slimAttrString + +syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="{" end="}" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar +syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="\[" end="\]" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar +syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="(" end=")" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar + +syn region slimAttrString start=+\s*"+ skip=+\%(\\\\\)*\\"+ end=+"\s*+ contained contains=slimInterpolation,slimInterpolationEscape nextgroup=slimAttr,slimRuby,slimInlineTagChar +syn region slimAttrString start=+\s*'+ skip=+\%(\\\\\)*\\"+ end=+'\s*+ contained contains=slimInterpolation,slimInterpolationEscape nextgroup=slimAttr,slimRuby,slimInlineTagChar + +syn region slimInnerAttrString start=+\s*"+ skip=+\%(\\\\\)*\\"+ end=+"\s*+ contained contains=slimInterpolation,slimInterpolationEscape nextgroup=slimAttr +syn region slimInnerAttrString start=+\s*'+ skip=+\%(\\\\\)*\\"+ end=+'\s*+ contained contains=slimInterpolation,slimInterpolationEscape nextgroup=slimAttr + +syn region slimInterpolation matchgroup=slimInterpolationDelimiter start="#{" end="}" contains=@hamlRubyTop containedin=javascriptStringS,javascriptStringD,slimWrappedAttrs +syn match  slimInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)" + +syn region slimRuby matchgroup=slimRubyOutputChar start="\s*[=]\==[']\=" skip=",\s*$" end="$" contained contains=@slimRubyTop keepend +syn region slimRuby matchgroup=slimRubyChar       start="\s*-"           skip=",\s*$" end="$" contained contains=@slimRubyTop keepend + +syn match slimComment /^\(\s*\)[/].*\(\n\1\s.*\)*/ contains=slimTodo +syn match slimText    /^\(\s*\)[`|'].*\(\n\1\s.*\)*/ + +syn match slimFilter /\s*\w\+:\s*/                            contained +syn match slimHaml   /^\(\s*\)\<haml:\>.*\(\n\1\s.*\)*/       contains=@slimHaml,slimFilter + +syn match slimIEConditional "\%(^\s*/\)\@<=\[\s*if\>[^]]*]" contained containedin=slimComment + +hi def link slimAttrString                String +hi def link slimBegin                     String +hi def link slimClass                     Type +hi def link slimClassChar                 Type +hi def link slimComment                   Comment +hi def link slimDocType                   Identifier +hi def link slimDocTypeKeyword            Keyword +hi def link slimFilter                    Keyword +hi def link slimIEConditional             SpecialComment +hi def link slimId                        Identifier +hi def link slimIdChar                    Identifier +hi def link slimInnerAttrString           String +hi def link slimInterpolationDelimiter    Delimiter +hi def link slimRubyChar                  Special +hi def link slimRubyOutputChar            Special +hi def link slimText                      String +hi def link slimTodo                      Todo +hi def link slimWrappedAttrValueDelimiter Delimiter +hi def link slimWrappedAttrsDelimiter     Delimiter +hi def link slimInlineTagChar             Delimiter + +let b:current_syntax = "slim" diff --git a/syntax/stylus.vim b/syntax/stylus.vim new file mode 100644 index 00000000..930e0b9b --- /dev/null +++ b/syntax/stylus.vim @@ -0,0 +1,372 @@ +" Vim syntax file +" Language:	CSS3 +" Maintainer:	Hsiaoming Yang <lepture@me.com> +" URL: http://lepture.me/work/css3/ +" Created:	Dec 14, 2011 +" Modified:	Sep 4, 2012 + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if !exists("main_syntax") +  if version < 600 +    syntax clear +  elseif exists("b:current_syntax") +    finish +  endif +  let main_syntax = 'css' +endif + +syn case ignore +syn region cssString start='"' end='"' contained +syn region cssString start="'" end="'" contained + +" HTML4 tags +syn keyword cssTagName abbr acronym address applet area base a b +syn keyword cssTagName basefont bdo big blockquote body button br +syn keyword cssTagName caption cite code col colgroup dd del +syn keyword cssTagName dfn dir div dl dt em fieldset form frame +syn keyword cssTagName frameset h1 h2 h3 h4 h5 h6 head hr html img i +syn keyword cssTagName iframe img input ins isindex kbd label legend li +syn keyword cssTagName link map menu meta noframes noscript ol optgroup +syn keyword cssTagName option p param pre q s samp script select +syn keyword cssTagName span strike strong style sub sup tbody td +syn keyword cssTagName textarea tfoot th thead title tr tt ul u var +syn match cssTagName "\*" +syn match cssTagName /\<table\>/ +syn match cssTagName /\<small\>/ +syn match cssTagName /\<center\>/ +" HTML5 tags +syn keyword cssTagName article aside audio bb canvas command datagrid +syn keyword cssTagName datalist details dialog embed figure footer figcaption +syn keyword cssTagName header hgroup keygen mark meter nav output  +syn keyword cssTagName progress time rt rp section time video +syn match cssTagName /\<ruby\>/ +" class select +syn match cssSelector /\.[A-Za-z][A-Za-z0-9_-]\+/ +" id select +syn match cssSelector /#[A-Za-z][A-Za-z0-9_-]\+/ +syn region cssSelector start='\[' end='\]' contains=cssString + +syn region cssDefineBlock start="{" end="}" transparent contains=ALL + +syn keyword cssCommonVal inherit initial auto both normal hidden none medium contained + + +" Comment +syn keyword cssTodo FIXME TODO contained +syn region cssComment start="/\*" end="\*/" contains=cssTodo +syn match cssImportant "!\s*important\>" contained + +syn match cssValueInteger "[-+]\=\d\+" contained +syn match cssValueNumber "[-+]\=\d\+\(\.\d*\)\=" +syn match cssValueLength "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|vh\|vw\|vm\|fr\|gr\)" contained +syn match cssValueAngle "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\|turn\)" contained +syn match cssValueTime "+\=\d\+\(\.\d*\)\=\(ms\|s\)" contained +syn match cssValueFrequency "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)" contained + + +" Properties http://www.w3.org/community/webed/wiki/CSS/Properties +" background http://www.w3.org/TR/css3-background/ +syn match cssBackgroundProp /\(background-\(color\|image\|repeat\|attachment\|position\)\|background\)/ contained +syn match cssBackgroundProp /background-\(origin\|\(repeat\|position\)-[xy]\|clip\|size\)/ contained +syn match cssBackgroundProp /object-\(fit\|position\)/ contained +" http://www.evotech.net/blog/2010/02/css3-properties-values-browser-support/ +syn keyword cssBackgroundVal tb lr rl snap cover contain widthLength heightLength contained +syn match cssBackgroundVal /\(scale-down\|from-image\)/ contained +syn match cssBackgroundVal /repeat-[xy]/ contained +syn match cssBackgroundVal /no-repeat/ contained +syn keyword cssBackgroundVal circle ellipse to at contained +syn match cssBackgroundVal /\(closest\|farthest\)-\(side\|corner\)/ contained + +syn region cssFuncVal start="\(url\|calc\|min\|max\|counter\|cycle(\)" end=")" oneline contained contains=cssString,cssValueLength,cssValueInteger,cssValueNumber,cssValueAngle,cssValueTime,cssValueFrequency +syn region cssFuncVal start="\(linear\|radial\|repeating-linear\|repeating-radial\)-gradient(" end=")" oneline contained contains=cssString,cssValueLength,cssValueInteger,cssValueNumber,cssValueAngle,cssValueTime,cssValueFrequency,cssVisualProp,cssColorVal + +syn match cssBorderProp /\(border-\(color\|style\|width\|radius\)\|border\)/ contained +syn match cssBorderProp /border-\(image-\(source\|slice\|width\|outset\|repeat\)\|image\)/ contained +syn match cssBorderProp /border-\(\(top\|right\|bottom\|left\)-\(color\|style\|width\)\|\(top\|right\|bottom\|left\)\)/ contained +syn match cssBorderProp /border-\(top\|bottom\)-\(left\|right\)-radius/ contained +syn keyword cssBorderVal dotted dashed solid double groove ridge inset outset contained +syn match cssBorderVal /\<collapse\>/ contained +syn match cssBorderVal /\<separate\>/ contained +syn match cssBorderVal /\<fill\>/ contained + +" Font +syn match cssFontProp /\(font-\(family\|style\|variant\|weight\|size-adjust\|size\|stretch\)\|font\)/ contained +syn match cssFontVal /\(sans-serif\|small-caps\)/ contained +syn match cssFontVal /\<x\{1,2\}-\(large\|small\)\>/ contained +syn keyword cssFontVal cursive fantasy monospace italic oblique serif contained +syn keyword cssFontVal bold bolder lighter larger smaller contained +syn keyword cssFontVal icon narrower wider contained + +" Color +syn match cssColorVal /transparent/ contained +syn match cssColorVal "#[0-9A-Fa-f]\{3\}\>" contained +syn match cssColorVal "#[0-9A-Fa-f]\{6\}\>" contained +syn match cssFuncVal /rgb(\(\d\{1,3\}\s*,\s*\)\{2\}\d\{1,3\})/ contained contains=cssString,cssValueLength,cssValueInteger,cssValueNumber,cssValueAngle,cssValueTime,cssValueFrequency +syn match cssFuncVal /rgba(\(\d\{1,3\}\s*,\s*\)\{3\}\(1\|0\(\.\d\+\)\?\))/ contained contains=cssString,cssValueLength,cssValueInteger,cssValueNumber,cssValueAngle,cssValueTime,cssValueFrequency  +syn match cssFuncVal /hsl(\d\{1,3\}\s*,\s*\(100\|\d\{1,2\}\(\.\d\+\)\?\)%\s*,\s*\(100\|\d\{1,2\}\(\.\d\+\)\?\)%)/ contained contains=cssString,cssValueLength,cssValueInteger,cssValueNumber,cssValueAngle,cssValueTime,cssValueFrequency +syn match cssFuncVal /hsla(\d\{1,3\}\s*,\s*\(\(100\|\d\{1,2\}\(\.\d\+\)\?\)%\s*,\s*\)\{2\}\(1\|0\(\.\d\+\)\?\))/ contained contains=cssString,cssValueLength,cssValueInteger,cssValueNumber,cssValueAngle,cssValueTime,cssValueFrequency +syn keyword cssColorVal aliceblue antiquewhite aqua aquamarine azure contained +syn keyword cssColorVal beige bisque black blanchedalmond blue blueviolet brown burlywood contained +syn keyword cssColorVal cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan contained +syn match cssColorVal /dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)/ contained +syn match cssColorVal /dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)/ contained +syn match cssColorVal /darkslate\(blue\|gray\|grey\)/ contained +syn match cssColorVal /dark\(turquoise\|violet\)/ contained +syn keyword cssColorVal deeppink deepskyblue dimgray dimgrey dodgerblue firebrick contained +syn keyword cssColorVal floralwhite forestgreen fuchsia gainsboro ghostwhite gold contained +syn keyword cssColorVal goldenrod gray green greenyellow grey honeydew hotpink contained +syn keyword cssColorVal indianred indigo ivory khaki lavender lavenderblush lawngreen contained +syn keyword cssColorVal lemonchiffon lime limegreen linen magenta maroon contained +syn match cssColorVal /light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)/ contained +syn match cssColorVal /light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)/ contained +syn match cssColorVal /light\(slategray\|slategrey\|steelblue\)/ contained +syn match cssColorVal /medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)/ contained +syn match cssColorVal /medium\(slateblue\|springgreen\|turquoise\|violetred\)/ contained +syn keyword cssColorVal midnightblue mintcream mistyrose moccasin navajowhite contained +syn keyword cssColorVal navy oldlace olive olivedrab orange orangered orchid contained +syn match cssColorVal /pale\(goldenrod\|green\|turquoise\|violetred\)/ contained +syn keyword cssColorVal papayawhip peachpuff peru pink plum powderblue purple contained +syn keyword cssColorVal red rosybrown royalblue saddlebrown salmon sandybrown contained +syn keyword cssColorVal seagreen seashell sienna silver skyblue slateblue contained +syn keyword cssColorVal slategray slategrey snow springgreen steelblue tan contained +syn keyword cssColorVal teal thistle tomato turquoise violet wheat contained +syn keyword cssColorVal whitesmoke yellow yellowgreen contained +syn match cssColorVal "\<white\>" contained +syn keyword cssColorProp color opaticy contained +syn match cssColorProp /color-profile/ contained + +" Box +syn match cssBoxProp /\(\(margin\|padding\)-\(top\|right\|bottom\|left\)\|\(margin\|padding\)\)/ contained +syn match cssBoxProp /\(min\|max\)-\(width\|height\)/ contained +syn match cssBoxProp /box-\(align\|decoration-break\|direction\|flex-group\|flex\|lines\)/ contained +syn match cssBoxProp /box-\(ordinal-group\|orient\|pack\|shadow\|sizing\)/ contained +syn match cssBoxProp /\(outline-\(color\|offset\|style\|width\)\|outline\)/ contained +syn keyword cssBoxProp width height contained + +" Text +syn match cssTextProp /text-\(align-last\|align\|decoration\|emphasis\|height\|indent\|justify\|outline\|shadow\|transform\|wrap\|overflow\)\|text/ contained +syn match cssTextProp /\(line-stacking-\(ruby\|shift\|strategy\)\|line-stacking\|line-height\)/ contained +syn match cssTextProp /vertical-align/ contained +syn match cssTextProp /letter-spacing/ contained +syn match cssTextProp /white-\(space-collapse\|space\)/ contained +syn match cssTextProp /word-\(break\|spacing\|wrap\)/ contained +syn match cssTextProp "\<word-wrap\>" contained +syn match cssTextVal "\<break-word\>" contained +syn match cssTextVal "\<break-all\>" contained +syn match cssTextVal "\<line-through\>" contained +syn match cssTextVal /text-\(top\|bottom\)/ contained +syn keyword cssTextVal uppercase lowercase ellipsis middle contained + +" List +syn match cssListProp /\(list-style-\(type\|image\|position\)\|list-style\)/ contained +syn keyword cssListVal armenian circle disc georgian hebrew square contained +syn match cssListVal /cjk-ideographic/ contained +syn match cssListVal /\(decimal-leading-zero\|decimal\)/ contained +syn match cssListVal /\(\(hiragana\|katakana\)-iroha\|\(hiragana\|katakana\)\)/ contained +syn match cssListVal /\(lower\|upper\)-\(alpha\|latin\|roman\)/ contained +syn match cssListVal /lower-greek/ contained + +" Visual formatting +syn keyword cssVisualProp display position top right bottom left float clear clip contained +syn keyword cssVisualProp zoom visibility cursor direction outline resize contained +syn keyword cssVisualProp opacity contained +syn match cssVisualProp /z-index/ contained +syn match cssVisualProp /\(overflow-\(style\|[xy]\)\|overflow\)/ contained +syn keyword cssVisualVal inline block compact contained +syn match cssVisualVal '\<table\>' contained +syn match cssVisualVal /\(inline-\(block\|table\)\|list-item\|run-in\)/ contained +syn match cssVisualVal /table-\(row-group\|header-group\|footer-group\|row\|column-group\|column\|cell\|caption\)/ contained +syn match cssVisualVal /\<ruby\>-\(base-group\|text-group\|base\|text\)/  contained +syn keyword cssVisualVal static relative absolute fixed contained +syn keyword cssVisualVal ltr rtl embed bidi-override pre nowrap contained +syn keyword cssVisualVal crosshair help move pointer progress wait contained +syn keyword cssVisualVal e-resize n-resize ne-resize nw-resize s-resize se-resize sw-resize w-resize contained + +" Table +syn match cssTableProp /border-\(collapse\|spacing\)/ contained +syn match cssTableProp /\(table-layout\|caption-side\|empty-cells\)/ contained + +" Generated content +syn match cssCommonProp /counter-\(reset\|increment\)/ contained +syn keyword cssCommonProp content quotes contained + +" Print +syn match cssPrintProp /break-\(before\|after\|inside\)/ +syn match cssPrintProp /\(page-break-\(before\|after\|inside\)\|page-policy\)/ +syn keyword cssPrintProp orphans windows + +" special keywords +syn match cssSpecialProp /-\(webkit\|moz\|ms\|o\)-/ +syn match cssRuleProp /@\(media\|font-face\|charset\|import\|page\|namespace\)/ +" http://www.w3.org/TR/selectors/ +syn match cssPseudo /:\(link\|visited\|active\|hover\|focus\|before\|after\)/ +syn match cssPseudo /:\(target\|lang\|enabled\|disabled\|checked\|indeterminate\)/ +syn match cssPseudo /:\(root\|\(first\|last\|only\)-\(child\|of-type\)\|empty\)/ +syn match cssPseudo /:\(nth-last-\|nth-\)\(child\|of-type\)(\<\S\+\>)/ +syn match cssPseudo /:not(\<\S*\>)/ +syn match cssPseudo /:first-\(line\|letter\)/ +syn match cssPseudo /::\(first-\(line\|letter\)\|before\|after\|selection\)/ + +" CSS3 Advanced http://meiert.com/en/indices/css-properties/ +syn keyword cssAdvancedProp appearance azimuth binding bleed columns crop hyphens icon +syn keyword cssAdvancedProp phonemes resize richness size volumne +syn match cssAdvancedProp /\(animation-\(delay\|direction\|duration\|name\|iteration-count\|play-state\|timing-function\)\|animation\)/ +syn match cssAdvancedProp /alignment-\(adjust\|baseline\)/ +syn match cssAdvancedProp /\(backface-visibility\baseline-shift\)/ +syn match cssAdvancedProp /bookmark-\(label\|level\|state\|target\)/ +syn match cssAdvancedProp /column-\(count\|fill\|gap\|rule-\(color\|style\|width\)\|rule\|span\|width\)/ +syn match cssAdvancedProp /\(cue-\(after\|before\)\|cue\)/ +syn match cssAdvancedProp /dominant-baseline/ +syn match cssAdvancedProp /drop-initial-\(size\|value\|\(after\|before\)-\(adjust\|align\)\)/ +syn match cssAdvancedProp /\(fit-position\|fit\)/ +syn match cssAdvancedProp /\(float-offset\|hanging-punctuation\)/ +syn match cssAdvancedProp /grid-\(columns\|rows\)/ +syn match cssAdvancedProp /hyphenate-\(after\|before\|character\|lines\|resource\)/ +syn match cssAdvancedProp /image-\(orientation\|rendering\|resolution\)/ +syn match cssAdvancedProp /inline-box-align/ +syn match cssAdvancedProp /\(mark-\(after\|before\)\|mark\|marks\)/ +syn match cssAdvancedProp /marquee-\(direction\|loop\|play-count\|speed\|style\)/ +syn match cssAdvancedProp /move-to/ +syn match cssAdvancedProp /nav-\(down\|index\|left\|right\|up\)/ +syn match cssAdvancedProp /\(pause-\(after\|before\)\|pause\)/ +syn match cssAdvancedProp /\(perspective-origin\|perspective\)/ +syn match cssAdvancedProp /\(pitch-range\|pitch\)/ +syn match cssAdvancedProp /presentation-level/ +syn match cssAdvancedProp /punctuation-trim/ +syn match cssAdvancedProp /rendering-intent/ +syn match cssAdvancedProp /\(rest-\(after\|before\)\|rest\)/ +syn match cssAdvancedProp /\(rotation-point\|rotation\)/ +syn match cssAdvancedProp /ruby-\(align\|overhang\|position\|span\)/ +syn match cssAdvancedProp /\(target-\(name\|new\|position\)\|target\)/ +syn match cssAdvancedProp /\(transform-\(origin\|style\)\|transform\)/ +syn match cssAdvancedProp /\(transition-\(delay\|duration\|property\|timing-function\)\|transition\)/ +syn match cssAdvancedProp /voice-\(balance\|duration\|family\|pitch-range\|pitch\|rate\|stress\|volume\)/ + +syn match cssAdvancedVal /\(ease-\(in\|out\|in-out\)\|ease\)/ contained + +" CSS3 Advanced value  +"syn match cssAdvancedVal  + + +if main_syntax == "css" +  syn sync minlines=10 +endif + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_css_syn_inits") +  if version < 508 +    let did_css_syn_inits = 1 +    command -nargs=+ HiLink hi link <args> +  else +    command -nargs=+ HiLink hi def link <args> +  endif + +  HiLink cssString String +  HiLink cssComment Comment +  HiLink cssTagName Statement +  HiLink cssSelector Function +  HiLink cssBackgroundProp StorageClass +  HiLink cssTableProp StorageClass +  HiLink cssBorderProp StorageClass +  HiLink cssFontProp StorageClass +  HiLink cssColorProp StorageClass +  HiLink cssBoxProp StorageClass +  HiLink cssTextProp StorageClass +  HiLink cssListProp StorageClass +  HiLink cssVisualProp StorageClass +  HiLink cssAdvancedProp StorageClass +  HiLink cssCommonProp StorageClass +  HiLink cssSpecialProp Special  +  HiLink cssImportant Special +  HiLink cssRuleProp PreProc +  HiLink cssPseudo PreProc + +  HiLink cssColorVal Constant +  HiLink cssCommonVal Type +  HiLink cssFontVal Type +  HiLink cssListVal Type +  HiLink cssTextVal Type +  HiLink cssVisualVal Type +  HiLink cssBorderVal Type +  HiLink cssBackgroundVal Type +  HiLink cssFuncVal Function +  HiLink cssAdvancedVal Function + +  HiLink cssValueLength Number +  HiLink cssValueInteger Number +  HiLink cssValueNumber Number +  HiLink cssValueAngle Number +  HiLink cssValueTime Number +  HiLink cssValueFrequency Number +  delcommand HiLink +endif + +" let b:current_syntax = "css" +"  +if main_syntax == 'css' +  unlet main_syntax +endif + +" Vim syntax file +" Language: Stylus +" Maintainer: Marc Harter +" Filenames: *.styl, *.stylus +" Based On: Tim Pope (sass.vim) + +syn case ignore +syn region cssInclude start="@import" end="\n" contains=cssComment,cssFuncVal,cssRuleProp + +syn cluster stylusCssSelectors contains=cssTagName,cssSelector,cssPseudo +syn cluster stylusCssValues contains=cssValueLength,cssValueInteger,cssValueNumber,cssValueAngle,cssValueTime,cssValueFrequency,cssColorVal,cssCommonVal,cssFontVal,cssListVal,cssTextVal,cssVisualVal,cssBorderVal,cssBackgroundVal,cssFuncVal,cssAdvancedVal +syn cluster stylusCssProperties contains=cssBackgroundProp,cssTableProp,cssBorderProp,cssFontProp,cssColorProp,cssBoxProp,cssTextProp,cssListProp,cssVisualProp,cssAdvancedProp,cssCommonProp,cssSpecialProp + +syn match stylusVariable "$\?[[:alnum:]_-]\+" +syn match stylusVariableAssignment "\%([[:alnum:]_-]\+\s*\)\@<==" nextgroup=stylusCssAttribute,stylusVariable skipwhite + +syn match stylusProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+:" contains=@stylusCssProperties,@stylusCssSelectors skipwhite nextgroup=stylusCssAttribute contained containedin=cssDefineBlock +syn match stylusProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+[ :]\|:[[:alnum:]-]\+\)"hs=s+1 contains=@stylusCssProperties,@stylusCssSelectors skipwhite nextgroup=stylusCssAttribute +syn match stylusProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=@stylusCssProperties,@stylusCssSelectors skipwhite nextgroup=stylusCssAttribute + +syn match stylusCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@stylusCssValues,cssImportant,stylusFunction,stylusVariable,stylusControl,stylusUserFunction,stylusInterpolation,cssString,stylusComment,cssComment + +syn match stylusInterpolation %{[[:alnum:]_-]\+}% + +syn match stylusFunction "\<\%(red\|green\|blue\|alpha\|dark\|light\)\>(\@=" contained +syn match stylusFunction "\<\%(hue\|saturation\|lightness\|push\|unshift\|typeof\|unit\|match\)\>(\@=" contained +syn match stylusFunction "\<\%(hsla\|hsl\|rgba\|rgb\|lighten\|darken\)\>(\@=" contained +syn match stylusFunction "\<\%(abs\|ceil\|floor\|round\|min\|max\|even\|odd\|sum\|avg\|sin\|cos\|join\)\>(\@=" contained +syn match stylusFunction "\<\%(desaturate\|saturate\|invert\|unquote\|quote\|s\)\>(\@=" contained +syn match stylusFunction "\<\%(operate\|length\|warn\|error\|last\|p\|\)\>(\@=" contained +syn match stylusFunction "\<\%(opposite-position\|image-size\|add-property\)\>(\@=" contained + +syn keyword stylusVariable null true false arguments +syn keyword stylusControl  if else unless for in return + +syn match stylusAmpersand  "&" +syn match stylusClass      "[[:alnum:]_-]\+" contained +syn match stylusClassChar  "\.[[:alnum:]_-]\@=" nextgroup=stylusClass +syn match stylusEscape     "^\s*\zs\\" +syn match stylusId         "[[:alnum:]_-]\+" contained +syn match stylusIdChar     "#[[:alnum:]_-]\@=" nextgroup=stylusId + +syn region stylusComment    start="//" end="$" contains=cssTodo,@Spell fold + +hi def link stylusComment               Comment +hi def link stylusVariable              Identifier +hi def link stylusControl               PreProc +hi def link stylusFunction              Function +hi def link stylusInterpolation         Delimiter + +hi def link stylusAmpersand             Character +hi def link stylusClass                 Type +hi def link stylusClassChar             Special +hi def link stylusEscape                Special +hi def link stylusId                    Identifier +hi def link stylusIdChar                Special + +let b:current_syntax = "stylus" + +" vim:set sw=2: diff --git a/syntax/textile.vim b/syntax/textile.vim new file mode 100644 index 00000000..e9534e9b --- /dev/null +++ b/syntax/textile.vim @@ -0,0 +1,91 @@ +" +"   You will have to restart vim for this to take effect.  In any case +"   it is a good idea to read ":he new-filetype" so that you know what +"   is going on, and why the above lines work. +" +"   Written originally by Dominic Mitchell, Jan 2006. +"   happygiraffe.net +" +"   Modified by Aaron Bieber, May 2007. +"   blog.aaronbieber.com +" +"   Modified by Tim Harper, July 2008 - current +"   tim.theenchanter.com +" @(#) $Id$ + +if version < 600 +    syntax clear +elseif exists("b:current_syntax") +    finish +endif + +" Textile commands like "h1" are case sensitive, AFAIK. +syn case match + +" Textile syntax: <http://textism.com/tools/textile/> + +" Inline elements. +syn match txtEmphasis    /_[^_]\+_/ +syn match txtBold        /\*[^*]\+\*/ +syn match txtCite        /??.\+??/ +syn match txtDeleted     /-[^-]\+-/ +syn match txtInserted    /+[^+]\++/ +syn match txtSuper       /\^[^^]\+\^/ +syn match txtSub         /\~[^~]\+\~/ +syn match txtSpan        /%[^%]\+%/ +syn match txtFootnoteRef /\[[0-9]\+]/ +syn match txtCode        /@[^@]\+@/ + +" Block elements. +syn match txtHeader      /^h1\(([^)]*)\|{[^}]*}\|\[[^]]*\]\|[<>=()]\)*\. .\+/ +syn match txtHeader2     /^h2\(([^)]*)\|{[^}]*}\|\[[^]]*\]\|[<>=()]\)*\. .\+/ +syn match txtHeader3     /^h[3-6]\(([^)]*)\|{[^}]*}\|\[[^]]*\]\|[<>=()]\)*\..\+/ +syn match txtFootnoteDef /^fn[0-9]\+\(([^)]*)\|{[^}]*}\|\[[^]]*\]\|[<>=()]\)*\./ +syn match txtListBullet  /\v^\*+ / +syn match txtListBullet2  /\v^(\*\*)+ / +syn match txtListNumber  /\v^#+ / +syn match txtListNumber2  /\v^(##)+ / + +syn region txtCodeblock start="^bc\(([^)]*)\|{[^}]*}\|\[[^]]*\]\|[<>=()]\)*\. " end="^$" +syn region txtBlockquote start="^bq\(([^)]*)\|{[^}]*}\|\[[^]]*\]\|[<>=()]\)*\. " end="^$" +syn region txtParagraph start="^bq\(([^)]*)\|{[^}]*}\|\[[^]]*\]\|[<>=()]\)*\. " end="^$" + +syn cluster txtBlockElement contains=txtHeader,txtBlockElement,txtFootnoteDef,txtListBullet,txtListNumber + + +" Everything after the first colon is from RFC 2396, with extra +" backslashes to keep vim happy...  Original: +" ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? +" +" Revised the pattern to exclude spaces from the URL portion of the +" pattern. Aaron Bieber, 2007. +syn match txtLink /"[^"]\+":\(\([^:\/?# ]\+\):\)\?\(\/\/\([^\/?# ]*\)\)\?\([^?# ]*\)\(?\([^# ]*\)\)\?\(#\([^ ]*\)\)\?/ + +syn cluster txtInlineElement contains=txtEmphasis,txtBold,txtCite,txtDeleted,txtInserted,txtSuper,txtSub,txtSpan + +if version >= 508 || !exists("did_txt_syn_inits") +    if version < 508 +        let did_txt_syn_inits = 1 +        command -nargs=+ HiLink hi link <args> +    else +        command -nargs=+ HiLink hi def link <args> +    endif + +    HiLink txtHeader Title +    HiLink txtHeader2 Question +    HiLink txtHeader3 Statement +    HiLink txtBlockquote Comment +    HiLink txtCodeblock Identifier +    HiLink txtListBullet Operator +    HiLink txtListBullet2 Constant +    HiLink txtListNumber Operator +    HiLink txtListNumber2 Constant +    HiLink txtLink String +    HiLink txtCode Identifier +    hi def txtEmphasis term=underline cterm=underline gui=italic +    hi def txtBold term=bold cterm=bold gui=bold + +    delcommand HiLink +endif + +" vim: set ai et sw=4 : diff --git a/syntax/tmux.vim b/syntax/tmux.vim new file mode 100644 index 00000000..ae24be76 --- /dev/null +++ b/syntax/tmux.vim @@ -0,0 +1,104 @@ +" Vim syntax file +" Language: tmux(1) configuration file +" Maintainer: Tiago Cunha <me@tiagocunha.org> +" Last Change: $Date: 2010-07-27 18:29:07 $ +" License: This file is placed in the public domain. + +if version < 600 +	syntax clear +elseif exists("b:current_syntax") +	finish +endif + +setlocal iskeyword+=- +syntax case match + +syn keyword tmuxAction	any current none +syn keyword tmuxBoolean	off on + +syn keyword tmuxCmds detach[-client] ls list-sessions neww new-window +syn keyword tmuxCmds bind[-key] unbind[-key] prev[ious-window] last[-window] +syn keyword tmuxCmds lsk list-keys set[-option] renamew rename-window selectw +syn keyword tmuxCmds select-window lsw list-windows attach[-session] +syn keyword tmuxCmds send-prefix refresh[-client] killw kill-window lsc +syn keyword tmuxCmds list-clients linkw link-window unlinkw unlink-window +syn keyword tmuxCmds next[-window] send[-keys] swapw swap-window +syn keyword tmuxCmds rename[-session] kill-session switchc switch-client +syn keyword tmuxCmds has[-session] copy-mode pasteb paste-buffer +syn keyword tmuxCmds new[-session] start[-server] kill-server setw +syn keyword tmuxCmds set-window-option show[-options] showw show-window-options +syn keyword tmuxCmds command-prompt setb set-buffer showb show-buffer lsb +syn keyword tmuxCmds list-buffers deleteb delete-buffer lscm list-commands +syn keyword tmuxCmds movew move-window respawnw respawn-window +syn keyword tmuxCmds source[-file] info server-info clock-mode lock[-server] +syn keyword tmuxCmds saveb save-buffer killp +syn keyword tmuxCmds kill-pane resizep resize-pane selectp select-pane swapp +syn keyword tmuxCmds swap-pane splitw split-window choose-session +syn keyword tmuxCmds choose-window loadb load-buffer copyb copy-buffer suspendc +syn keyword tmuxCmds suspend-client findw find-window breakp break-pane nextl +syn keyword tmuxCmds next-layout rotatew rotate-window confirm[-before] +syn keyword tmuxCmds clearhist clear-history selectl select-layout if[-shell] +syn keyword tmuxCmds display[-message] setenv set-environment showenv +syn keyword tmuxCmds show-environment choose-client displayp display-panes +syn keyword tmuxCmds run[-shell] lockc lock-client locks lock-session lsp +syn keyword tmuxCmds list-panes pipep pipe-pane showmsgs show-messages capturep +syn keyword tmuxCmds capture-pane joinp join-pane choose-buffer + +syn keyword tmuxOptsSet prefix status status-fg status-bg bell-action +syn keyword tmuxOptsSet default-command history-limit status-left status-right +syn keyword tmuxOptsSet status-interval set-titles display-time buffer-limit +syn keyword tmuxOptsSet status-left-length status-right-length +syn keyword tmuxOptsSet message-[command-]bg lock-after-time default-path +syn keyword tmuxOptsSet message-[command-]attr status-attr set-remain-on-exit +syn keyword tmuxOptsSet status-utf8 default-terminal visual-activity repeat-time +syn keyword tmuxOptsSet visual-bell visual-content status-justify status-keys +syn keyword tmuxOptsSet terminal-overrides status-left-attr status-left-bg +syn keyword tmuxOptsSet status-left-fg status-right-attr status-right-bg +syn keyword tmuxOptsSet status-right-fg update-environment base-index +syn keyword tmuxOptsSet display-panes-colour display-panes-time default-shell +syn keyword tmuxOptsSet set-titles-string lock-command lock-server +syn keyword tmuxOptsSet mouse-select-pane message-limit quiet escape-time +syn keyword tmuxOptsSet pane-active-border-bg pane-active-border-fg +syn keyword tmuxOptsSet pane-border-bg pane-border-fg message-[command-]fg +syn keyword tmuxOptsSet display-panes-active-colour alternate-screen +syn keyword tmuxOptsSet detach-on-destroy + +syn keyword tmuxOptsSetw monitor-activity aggressive-resize force-width +syn keyword tmuxOptsSetw force-height remain-on-exit uft8 mode-fg mode-bg +syn keyword tmuxOptsSetw mode-keys clock-mode-colour clock-mode-style +syn keyword tmuxOptsSetw xterm-keys mode-attr window-status-attr +syn keyword tmuxOptsSetw window-status-bg window-status-fg automatic-rename +syn keyword tmuxOptsSetw main-pane-width main-pane-height monitor-content +syn keyword tmuxOptsSetw window-status-current-attr window-status-current-bg +syn keyword tmuxOptsSetw window-status-current-fg mode-mouse synchronize-panes +syn keyword tmuxOptsSetw window-status-format window-status-current-format +syn keyword tmuxOptsSetw word-separators window-status-alert-attr +syn keyword tmuxOptsSetw window-status-alert-bg window-status-alert-fg + +syn keyword tmuxTodo FIXME NOTE TODO XXX contained + +syn match tmuxKey		/\(C-\|M-\|\^\)\+\S\+/	display +syn match tmuxNumber 		/\d\+/			display +syn match tmuxOptions		/\s-\a\+/		display +syn match tmuxVariable		/\w\+=/			display +syn match tmuxVariableExpansion	/\${\=\w\+}\=/		display + +syn region tmuxComment	start=/#/ end=/$/ contains=tmuxTodo display oneline +syn region tmuxString	start=/"/ end=/"/ display oneline +syn region tmuxString	start=/'/ end=/'/ display oneline + +hi def link tmuxAction			Boolean +hi def link tmuxBoolean			Boolean +hi def link tmuxCmds			Keyword +hi def link tmuxComment			Comment +hi def link tmuxKey			Special +hi def link tmuxNumber			Number +hi def link tmuxOptions			Identifier +hi def link tmuxOptsSet			Function +hi def link tmuxOptsSetw		Function +hi def link tmuxString			String +hi def link tmuxTodo			Todo +hi def link tmuxVariable		Constant +hi def link tmuxVariableExpansion	Constant + +let b:current_syntax = "tmux" | 
