diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2024-11-19 22:57:13 +0000 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2024-11-19 22:57:13 +0000 |
| commit | 9be89f131f87608f224f0ee06d199fcd09d32176 (patch) | |
| tree | 11022dcfa9e08cb4ac5581b16734196128688d48 /runtime/syntax | |
| parent | ff7ed8f586589d620a806c3758fac4a47a8e7e15 (diff) | |
| parent | 88085c2e80a7e3ac29aabb6b5420377eed99b8b6 (diff) | |
| download | rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.gz rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.bz2 rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.zip | |
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'runtime/syntax')
61 files changed, 4389 insertions, 876 deletions
diff --git a/runtime/syntax/antlr4.vim b/runtime/syntax/antlr4.vim new file mode 100644 index 0000000000..33cc865ccc --- /dev/null +++ b/runtime/syntax/antlr4.vim @@ -0,0 +1,30 @@ +" Vim syntax file +" Language: ANTLR4, ANother Tool for Language Recognition v4 <www.antlr.org> +" Maintainer: Yinzuo Jiang <jiangyinzuo@foxmail.com> +" Last Change: 2024 July 09 + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +" Keywords. See https://github.com/antlr/antlr4/blob/4.13.1/doc/lexicon.md +syn keyword antlr4Include import +" https://github.com/antlr/antlr4/blob/4.13.1/doc/options.md +" https://github.com/antlr/antlr4/blob/4.13.1/doc/grammars.md +syn keyword antlr4Structure fragment lexer parser grammar options channels tokens mode +syn keyword antlr4Statement returns locals +syn keyword antlr4Exceptions throws catch finally + +" Comments. +syn keyword antlr4Todo contained TODO FIXME XXX NOTE +syn region antlr4Comment start="//" end="$" contains=antlr4Todo,@Spell +syn region antlr4Comment start="/\*" end="\*/" contains=antlr4Todo,@Spell + +hi def link antlr4Include Include +hi def link antlr4Structure Structure +hi def link antlr4Statement Statement +hi def link antlr4Exceptions Structure +hi def link antlr4Comment Comment + +let b:current_syntax = "antlr4" diff --git a/runtime/syntax/asy.vim b/runtime/syntax/asy.vim new file mode 100644 index 0000000000..ed2bf712f5 --- /dev/null +++ b/runtime/syntax/asy.vim @@ -0,0 +1,243 @@ +" Vim syntax file +" Language: Asymptote +" Maintainer: Avid Seeker <avidseeker7@protonmail.com> +" Andy Hammerlindl +" Last Change: 2022 Jan 05 + +" Hacked together from Bram Moolenaar's C syntax file, and Claudio Fleiner's +" Java syntax file. + +if exists("b:current_syntax") + finish +endif + +" useful C/C++/Java keywords +syn keyword asyStatement break return continue unravel +syn keyword asyConditional if else +syn keyword asyRepeat while for do +syn keyword asyExternal access from import include +syn keyword asyOperator new operator + +" basic asymptote keywords +syn keyword asyConstant VERSION +syn keyword asyConstant true false default infinity inf nan +syn keyword asyConstant null nullframe nullpath nullpen +syn keyword asyConstant intMin intMax realMin realMax +syn keyword asyConstant realEpsilon realDigits +syn keyword asyPathSpec and cycle controls tension atleast curl +syn keyword asyStorageClass static public restricted private explicit +syn keyword asyStructure struct typedef +syn keyword asyType void bool bool3 int real string file +syn keyword asyType pair triple transform guide path pen frame +syn keyword asyType picture + +" module specific keywords +if exists("asy_syn_plain") + syn keyword asyConstant currentpicture currentpen defaultpen + syn keyword asyConstant inch inches cm mm bp pt up down right left + syn keyword asyConstant E NE N NW W SW S SE + syn keyword asyConstant ENE NNE NNW WNW WSW SSW SSE ESE + syn keyword asyConstant I pi twopi + syn keyword asyConstant CCW CW + syn keyword asyConstant undefined sqrtEpsilon Align mantissaBits + syn keyword asyConstant identity zeroTransform invert + syn keyword asyConstant stdin stdout + syn keyword asyConstant unitsquare unitcircle circleprecision + syn keyword asyConstant solid dotted Dotted dashed dashdotted + syn keyword asyConstant longdashed longdashdotted + syn keyword asyConstant squarecap roundcap extendcap + syn keyword asyConstant miterjoin roundjoin beveljoin + syn keyword asyConstant zerowinding evenodd basealign nobasealign + syn keyword asyConstant black white gray red green blue Cyan Magenta + syn keyword asyConstant Yellow Black cyan magenta yellow palered + syn keyword asyConstant palegreen paleblue palecyan palemagenta + syn keyword asyConstant paleyellow palegray lightred lightgreen + syn keyword asyConstant lightblue lightcyan lightmagenta lightyellow + syn keyword asyConstant lightgray mediumred mediumgreen mediumblue + syn keyword asyConstant mediumcyan mediummagenta mediumyellow + syn keyword asyConstant mediumgray heavyred heavygreen heavyblue + syn keyword asyConstant heavycyan heavymagenta lightolive heavygray + syn keyword asyConstant deepred deepgreen deepblue deepcyan + syn keyword asyConstant deepmagenta deepyellow deepgray darkred + syn keyword asyConstant darkgreen darkblue darkcyan darkmagenta + syn keyword asyConstant darkolive darkgray orange fuchsia chartreuse + syn keyword asyConstant springgreen purple royalblue salmon brown + syn keyword asyConstant olive darkbrown pink palegrey lightgrey + syn keyword asyConstant mediumgrey grey heavygrey deepgrey darkgrey + + if exists("asy_syn_texcolors") + syn keyword asyConstant GreenYellow Yellow Goldenrod Dandelion + syn keyword asyConstant Apricot Peach Melon YellowOrange Orange + syn keyword asyConstant BurntOrange Bittersweet RedOrange Mahogany + syn keyword asyConstant Maroon BrickRed Red OrangeRed RubineRed + syn keyword asyConstant WildStrawberry Salmon CarnationPink Magenta + syn keyword asyConstant VioletRed Rhodamine Mulberry RedViolet + syn keyword asyConstant Fuchsia Lavender Thistle Orchid DarkOrchid + syn keyword asyConstant Purple Plum Violet RoyalPurple BlueViolet + syn keyword asyConstant Periwinkle CadetBlue CornflowerBlue + syn keyword asyConstant MidnightBlue NavyBlue RoyalBlue Blue + syn keyword asyConstant Cerulean Cyan ProcessBlue SkyBlue Turquoise + syn keyword asyConstant TealBlue Aquamarine BlueGreen Emerald + syn keyword asyConstant JungleGreen SeaGreen Green ForestGreen + syn keyword asyConstant PineGreen LimeGreen YellowGreen SpringGreen + syn keyword asyConstant OliveGreen RawSienna Sepia Brown Tan Gray + syn keyword asyConstant Black White + endif + + if exists("asy_syn_x11colors") + syn keyword asyConstant AliceBlue AntiqueWhite Aqua Aquamarine Azure + syn keyword asyConstant Beige Bisque Black BlanchedAlmond Blue + syn keyword asyConstant BlueViolet Brown BurlyWood CadetBlue + syn keyword asyConstant Chartreuse Chocolate Coral CornflowerBlue + syn keyword asyConstant Cornsilk Crimson Cyan DarkBlue DarkCyan + syn keyword asyConstant DarkGoldenrod DarkGray DarkGreen DarkKhaki + syn keyword asyConstant DarkMagenta DarkOliveGreen DarkOrange + syn keyword asyConstant DarkOrchid DarkRed DarkSalmon DarkSeaGreen + syn keyword asyConstant DarkSlateBlue DarkSlateGray DarkTurquoise + syn keyword asyConstant DarkViolet DeepPink DeepSkyBlue DimGray + syn keyword asyConstant DodgerBlue FireBrick FloralWhite ForestGreen + syn keyword asyConstant Fuchsia Gainsboro GhostWhite Gold Goldenrod + syn keyword asyConstant Gray Green GreenYellow Honeydew HotPink + syn keyword asyConstant IndianRed Indigo Ivory Khaki Lavender + syn keyword asyConstant LavenderBlush LawnGreen LemonChiffon + syn keyword asyConstant LightBlue LightCoral LightCyan + syn keyword asyConstant LightGoldenrodYellow LightGreen LightGrey + syn keyword asyConstant LightPink LightSalmon LightSeaGreen + syn keyword asyConstant LightSkyBlue LightSlateGray LightSteelBlue + syn keyword asyConstant LightYellow Lime LimeGreen Linen Magenta + syn keyword asyConstant Maroon MediumAquamarine MediumBlue + syn keyword asyConstant MediumOrchid MediumPurple MediumSeaGreen + syn keyword asyConstant MediumSlateBlue MediumSpringGreen + syn keyword asyConstant MediumTurquoise MediumVioletRed MidnightBlue + syn keyword asyConstant MintCream MistyRose Moccasin NavajoWhite + syn keyword asyConstant Navy OldLace Olive OliveDrab Orange + syn keyword asyConstant OrangeRed Orchid PaleGoldenrod PaleGreen + syn keyword asyConstant PaleTurquoise PaleVioletRed PapayaWhip + syn keyword asyConstant PeachPuff Peru Pink Plum PowderBlue Purple + syn keyword asyConstant Red RosyBrown RoyalBlue SaddleBrown Salmon + syn keyword asyConstant SandyBrown SeaGreen Seashell Sienna Silver + syn keyword asyConstant SkyBlue SlateBlue SlateGray Snow SpringGreen + syn keyword asyConstant SteelBlue Tan Teal Thistle Tomato Turquoise + syn keyword asyConstant Violet Wheat White WhiteSmoke Yellow + syn keyword asyConstant YellowGreen + endif + + if exists("asy_syn_three") + syn keyword asyType path3 guide3 transform3 + syn keyword asyType projection light material patch surface tube + syn keyword asyConstant currentprojection currentlight defaultrender + syn keyword asyConstant identity4 O X Y Z + syn keyword asyConstant nolight nullpens + syn keyword asyConstant unitsphere unithemisphere unitplane octant1 + syn keyword asyConstant unitcone unitsolidcone unitcube unitcylinder + syn keyword asyConstant unitdisk unittube + endif +endif + + +" string constants +syn region asyCString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=asyCSpecial +syn match asyCSpecial display contained +\\\(['"?\\abfnrtv]\|\o\{1,3}\)+ +syn match asyCSpecial display contained +\\\(x[0-9A-F]\{1,2\}\|$\)+ +" double quoted strings only special character is \" +syn region asyString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=asySpecial +syn match asySpecial display contained +\(\\\)\@1<!\(\\\\\)*\zs\\"+ + + +" number constants +syn match asyNumbers display transparent "\<\d\|\.\d" + \ contains=asyNumber,asyNumberError +syn match asyNumber display contained "\d*\.\=\d*\(e[-+]\=\d\+\)\=" +" highlight number constants with two '.' or with '.' after an 'e' +syn match asyNumberError display contained "\d*\.\(\d\|e[-+]\=\)*\.[0-9.]*" +syn match asyNumberError display contained "\d*e[-+]\=\d*\.[0-9.]*" +syn match asyNumberError display contained "\d*e[-+]\=\(e[-+]\=\)*\.[0-9.]*" + + +" comments and comment strings +syn keyword asyTodo contained TODO FIXME XXX +syn sync ccomment asyComment minlines=15 +if exists("asy_comment_strings") + " A comment can contain asyString, asyCString, and asyNumber. But a "*/" + " inside a asy*String in a asyComment DOES end the comment! So we need to + " use a special type of asy*String: asyComment*String, which also ends on + " "*/", and sees a "*" at the start of the line as comment again. + " Unfortunately this doesn't very well work for // type of comments :-( + syn match asyCommentSkip contained "^\s*\*\($\|\s\+\)" + syn region asyCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ + \ end=+\*/+me=s-1 + \ contains=asySpecial,asyCommentSkip + syn region asyCommentCString contained start=+'+ skip=+\\\\\|\\'+ end=+'+ + \ end=+\*/+me=s-1 + \ contains=asyCSpecial,asyCommentSkip + syn region asyCommentLString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ + \ end="$" contains=asySpecial + syn region asyCommentLCString contained start=+'+ skip=+\\\\\|\\'+ end=+'+ + \ end="$" contains=asyCSpecial + syn region asyCommentL start="//" skip="\\$" end="$" keepend + \ contains=asyTodo,asyCommentLString, + \ asyCommentLCString,asyNumbers + syn region asyComment matchgroup=asyComment start="/\*" end="\*/" + \ contains=asyTodo,asyCommentStartError, + \ asyCommentString,asyCommentCString,asyNumbers +else + syn region asyCommentL start="//" skip="\\$" end="$" keepend + \ contains=asyTodo + syn region asyComment matchgroup=asyComment start="/\*" end="\*/" + \ contains=asyTodo,asyCommentStartError +endif + +" highlight common errors when starting/ending C comments +syn match asyCommentError display "\*/" +syn match asyCommentStartError display "/\*"me=e-1 contained + + +" delimiter matching errors +syn region asyCurly transparent start='{' end='}' + \ contains=TOP,asyCurlyError +syn region asyBrack transparent start='\[' end='\]' matchgroup=asyError + \ end=';' contains=TOP,asyBrackError +syn region asyParen transparent start='(' end=')' matchgroup=asyError + \ end=';' contains=TOP,asyParenError +syn match asyCurlyError display '}' +syn match asyBrackError display '\]' +syn match asyParenError display ')' +" for (;;) constructs are exceptions that allow ; inside parenthesis +syn region asyParen transparent matchgroup=asyParen + \ start='\(for\s*\)\@<=(' end=')' + \ contains=TOP,asyParenError + +" Define the default highlighting. +hi def link asyCommentL asyComment +hi def link asyConditional Conditional +hi def link asyRepeat Repeat +hi def link asyNumber Number +hi def link asyNumberError asyError +hi def link asyCurlyError asyError +hi def link asyBracketError asyError +hi def link asyParenError asyError +hi def link asyCommentError asyError +hi def link asyCommentStartError asyError +hi def link asyOperator Operator +hi def link asyStructure Structure +hi def link asyStorageClass StorageClass +hi def link asyExternal Include +hi def link asyDefine Macro +hi def link asyError Error +hi def link asyStatement Statement +hi def link asyType Type +hi def link asyConstant Constant +hi def link asyCommentString asyString +hi def link asyCommentCString asyString +hi def link asyCommentLString asyString +hi def link asyCommentLCString asyString +hi def link asyCommentSkip asyComment +hi def link asyString String +hi def link asyCString String +hi def link asyComment Comment +hi def link asySpecial SpecialChar +hi def link asyCSpecial SpecialChar +hi def link asyTodo Todo +hi def link asyPathSpec Statement + +let b:current_syntax = "asy" diff --git a/runtime/syntax/checkhealth.vim b/runtime/syntax/checkhealth.vim index 2fd0aed601..a4f6e016cb 100644 --- a/runtime/syntax/checkhealth.vim +++ b/runtime/syntax/checkhealth.vim @@ -14,7 +14,9 @@ syn case match syn keyword DiagnosticError ERROR[:] syn keyword DiagnosticWarn WARNING[:] syn keyword DiagnosticOk OK[:] -syn match helpSectionDelim "^======*\n.*$" -syn match healthHeadingChar "=" conceal cchar=─ contained containedin=helpSectionDelim +" Note: hs=e starts higlighting on the title line (instead of the "===" line). +syn match helpSectionDelim /^======*\n.*$/hs=e +highlight helpSectionDelim gui=reverse cterm=reverse +syn match healthHeadingChar "=" conceal cchar= contained containedin=helpSectionDelim let b:current_syntax = "checkhealth" diff --git a/runtime/syntax/chicken.vim b/runtime/syntax/chicken.vim index f53d872e74..958fc1f361 100644 --- a/runtime/syntax/chicken.vim +++ b/runtime/syntax/chicken.vim @@ -1,13 +1,13 @@ " Vim syntax file -" Language: Scheme (CHICKEN) -" Last Change: 2021 Oct 01 -" Author: Evan Hanson <evhan@foldling.org> -" Maintainer: Evan Hanson <evhan@foldling.org> -" Repository: https://git.foldling.org/vim-scheme.git -" URL: https://foldling.org/vim/syntax/chicken.vim -" Notes: This is supplemental syntax, to be loaded after the core Scheme -" syntax file (syntax/scheme.vim). Enable it by setting b:is_chicken=1 -" and filetype=scheme. +" Language: Scheme (CHICKEN) +" Last Change: 2024 Jun 21 +" Author: Evan Hanson <evhan@foldling.org> +" Maintainer: Evan Hanson <evhan@foldling.org> +" Repository: https://git.foldling.org/vim-scheme.git +" URL: https://foldling.org/vim/syntax/chicken.vim +" Notes: This is supplemental syntax, to be loaded after the core +" Scheme syntax file (syntax/scheme.vim). Enable it by +" setting b:is_chicken=1 and filetype=scheme. " Only to be used on top of the Scheme syntax. if !exists('b:did_scheme_syntax') diff --git a/runtime/syntax/csv.vim b/runtime/syntax/csv.vim new file mode 100644 index 0000000000..6295c3e29a --- /dev/null +++ b/runtime/syntax/csv.vim @@ -0,0 +1,38 @@ +" Maintainer: Maxim Kim <habamax@gmail.com> +" Converted from vim9script +" Last Update: 2024-06-18 + +if exists("b:current_syntax") + finish +endif + +let s:delimiter = get(b:, "csv_delimiter", ",") + +" generate bunch of following syntaxes: +" syntax match csvCol8 /.\{-}\(,\|$\)/ nextgroup=escCsvCol0,csvCol0 +" syntax region escCsvCol8 start=/ *"\([^"]*""\)*[^"]*/ end=/" *\(,\|$\)/ nextgroup=escCsvCol0,csvCol0 +for s:col in range(8, 0, -1) + let s:ncol = (s:col == 8 ? 0 : s:col + 1) + exe $'syntax match csvCol{s:col}' .. ' /.\{-}\(' .. s:delimiter .. '\|$\)/ nextgroup=escCsvCol' .. s:ncol .. ',csvCol' .. s:ncol + exe $'syntax region escCsvCol{s:col}' .. ' start=/ *"\([^"]*""\)*[^"]*/ end=/" *\(' .. s:delimiter .. '\|$\)/ nextgroup=escCsvCol' .. s:ncol .. ',csvCol' .. s:ncol +endfor + +hi def link csvCol1 Statement +hi def link csvCol2 Constant +hi def link csvCol3 Type +hi def link csvCol4 PreProc +hi def link csvCol5 Identifier +hi def link csvCol6 Special +hi def link csvCol7 String +hi def link csvCol8 Comment + +hi def link escCsvCol1 csvCol1 +hi def link escCsvCol2 csvCol2 +hi def link escCsvCol3 csvCol3 +hi def link escCsvCol4 csvCol4 +hi def link escCsvCol5 csvCol5 +hi def link escCsvCol6 csvCol6 +hi def link escCsvCol7 csvCol7 +hi def link escCsvCol8 csvCol8 + +let b:current_syntax = "csv" diff --git a/runtime/syntax/deb822sources.vim b/runtime/syntax/deb822sources.vim index f7d337fce9..ec45605905 100644 --- a/runtime/syntax/deb822sources.vim +++ b/runtime/syntax/deb822sources.vim @@ -40,7 +40,7 @@ syn match deb822sourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorre syn region deb822sourcesStrictField matchgroup=deb822sourcesEntryField start="^\%(Types\|URIs\|Suites\|Components\): *" end="$" contains=deb822sourcesType,deb822sourcesUri,deb822sourcesSupportedSuites,deb822sourcesUnsupportedSuites,deb822sourcesFreeComponent,deb822sourcesNonFreeComponent oneline syn region deb822sourcesField matchgroup=deb822sourcesOptionField start="^\%(Signed-By\|Check-Valid-Until\|Valid-Until-Min\|Valid-Until-Max\|Date-Max-Future\|InRelease-Path\): *" end="$" oneline syn region deb822sourcesField matchgroup=deb822sourcesMultiValueOptionField start="^\%(Architectures\|Languages\|Targets\)\%(-Add\|-Remove\)\?: *" end="$" oneline -syn region deb822sourcesStrictField matchgroup=deb822sourcesBooleanOptionField start="^\%(PDiffs\|Allow-Insecure\|Allow-Weak\|Allow-Downgrade-To-Insecure\|Trusted\|Check-Date\): *" end="$" contains=deb822sourcesYesNo oneline +syn region deb822sourcesStrictField matchgroup=deb822sourcesBooleanOptionField start="^\%(PDiffs\|Allow-Insecure\|Allow-Weak\|Allow-Downgrade-To-Insecure\|Trusted\|Check-Date\|Enabled\): *" end="$" contains=deb822sourcesYesNo oneline syn region deb822sourcesStrictField matchgroup=deb822sourcesForceBooleanOptionField start="^\%(By-Hash\): *" end="$" contains=deb822sourcesForce,deb822sourcesYesNo oneline hi def link deb822sourcesField Default diff --git a/runtime/syntax/debcopyright.vim b/runtime/syntax/debcopyright.vim index 6f76b5c868..cb9e8965de 100644 --- a/runtime/syntax/debcopyright.vim +++ b/runtime/syntax/debcopyright.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Debian copyright file " Maintainer: Debian Vim Maintainers -" Last Change: 2023 Jan 16 +" Last Change: 2024 Jul 28 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debcopyright.vim " Standard syntax initialization @@ -15,7 +15,7 @@ set cpo&vim syn case match syn match debcopyrightUrl "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" -syn match debcopyrightKey "^\%(Format\|Upstream-Name\|Upstream-Contact\|Disclaimer\|Source\|Comment\|Files\|Copyright\|License\|Files-Excluded\%(-[-a-zA-Z0-9]\+\)\=\): *" +syn match debcopyrightKey "^\%(Format\|Upstream-Name\|Upstream-Contact\|Disclaimer\|Source\|Comment\|Files\|Copyright\|License\|Files-\%(Excluded\|Included\)\%(-[-a-zA-Z0-9]\+\)\=\): *" syn match debcopyrightEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+" syn match debcopyrightEmail "<.\{-}>" syn match debcopyrightComment "^#.*$" contains=@Spell diff --git a/runtime/syntax/dockerfile.vim b/runtime/syntax/dockerfile.vim index ce52e697cd..6ec71fcdb6 100644 --- a/runtime/syntax/dockerfile.vim +++ b/runtime/syntax/dockerfile.vim @@ -1,6 +1,6 @@ " dockerfile.vim - Syntax highlighting for Dockerfiles " Maintainer: Honza Pokorny <https://honza.ca> -" Last Change: 2020 Feb 11 +" Last Change: 2024 Jul 03 " License: BSD " https://docs.docker.com/engine/reference/builder/ @@ -34,7 +34,7 @@ syntax region dockerfileJSON contained keepend start=/\v\[/ skip=/\v\\\_./ end syntax region dockerfileShell contained keepend start=/\v/ skip=/\v\\\_./ end=/\v$/ contains=@Shell syntax region dockerfileValue contained keepend start=/\v/ skip=/\v\\\_./ end=/\v$/ contains=dockerfileString -syntax region dockerfileComment start=/\v^\s*#/ end=/\v$/ +syntax region dockerfileComment start=/\v^\s*#/ end=/\v$/ contains=@Spell |