diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-21 23:50:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-21 23:50:29 +0800 |
commit | ee26b227e15abc263195d4c746d5dba9f0e6dec4 (patch) | |
tree | 270e62c0fecf3f75f13fde49658daf1af181b492 /runtime/syntax | |
parent | d18f8d5c2d82b209093b2feaa8921a4792b71d59 (diff) | |
download | rneovim-ee26b227e15abc263195d4c746d5dba9f0e6dec4.tar.gz rneovim-ee26b227e15abc263195d4c746d5dba9f0e6dec4.tar.bz2 rneovim-ee26b227e15abc263195d4c746d5dba9f0e6dec4.zip |
vim-patch:partial:938ae280c79b (#22356)
Update runtime files.
https://github.com/vim/vim/commit/938ae280c79b8cdb0fca60336ec4c090ecd8bb5a
Partially skip autocmd.txt: needs patch 8.2.5011.
Partially skip builtin.txt: needs patch 9.0.0411.
Partially skip eval.txt: needs patch 8.2.3783.
Cherry-pick :map-meta-keys from patch 9.0.1276.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'runtime/syntax')
-rw-r--r-- | runtime/syntax/debsources.vim | 10 | ||||
-rw-r--r-- | runtime/syntax/dosbatch.vim | 39 | ||||
-rw-r--r-- | runtime/syntax/fish.vim | 225 | ||||
-rw-r--r-- | runtime/syntax/fstab.vim | 8 | ||||
-rw-r--r-- | runtime/syntax/go.vim | 7 | ||||
-rw-r--r-- | runtime/syntax/html.vim | 4 | ||||
-rw-r--r-- | runtime/syntax/poefilter.vim | 4 |
7 files changed, 267 insertions, 30 deletions
diff --git a/runtime/syntax/debsources.vim b/runtime/syntax/debsources.vim index 69900c7a51..cbb3b36c10 100644 --- a/runtime/syntax/debsources.vim +++ b/runtime/syntax/debsources.vim @@ -2,7 +2,7 @@ " Language: Debian sources.list " Maintainer: Debian Vim Maintainers " Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl> -" Last Change: 2023 Jan 16 +" Last Change: 2023 Feb 06 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debsources.vim " Standard syntax initialization @@ -14,7 +14,9 @@ endif syn case match " A bunch of useful keywords -syn match debsourcesKeyword /\(deb-src\|deb\|main\|contrib\|non-free\|non-free-firmware\|restricted\|universe\|multiverse\)/ +syn match debsourcesType /\(deb-src\|deb\)/ +syn match debsourcesFreeComponent /\(main\|universe\)/ +syn match debsourcesNonFreeComponent /\(contrib\|non-free-firmware\|non-free\|restricted\|multiverse\)/ " Match comments syn match debsourcesComment /#.*/ contains=@Spell @@ -48,7 +50,9 @@ exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join " Associate our matches and regions with pretty colours hi def link debsourcesLine Error -hi def link debsourcesKeyword Statement +hi def link debsourcesType Statement +hi def link debsourcesFreeComponent Statement +hi def link debsourcesNonFreeComponent Statement hi def link debsourcesDistrKeyword Type hi def link debsourcesUnsupportedDistrKeyword WarningMsg hi def link debsourcesComment Comment diff --git a/runtime/syntax/dosbatch.vim b/runtime/syntax/dosbatch.vim index f003a65909..a75771bd2d 100644 --- a/runtime/syntax/dosbatch.vim +++ b/runtime/syntax/dosbatch.vim @@ -1,12 +1,12 @@ " Vim syntax file -" Language: MS-DOS batch file (with NT command extensions) -" Maintainer: Mike Williams <mrw@eandem.co.uk> +" Language: MS-DOS/Windows batch file (with NT command extensions) +" Maintainer: Mike Williams <mrmrdubya@gmail.com> " Filenames: *.bat -" Last Change: 6th September 2009 -" Web Page: http://www.eandem.co.uk/mrw/vim +" Last Change: 12th February 2023 " " Options Flags: " dosbatch_cmdextversion - 1 = Windows NT, 2 = Windows 2000 [default] +" dosbatch_colons_comment - any value to treat :: as comment line " " quit when a syntax file was already loaded @@ -92,7 +92,11 @@ syn match dosbatchComment "^rem\($\|\s.*$\)"lc=3 contains=dosbatchTodo,dosbatchS syn match dosbatchComment "^@rem\($\|\s.*$\)"lc=4 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell syn match dosbatchComment "\srem\($\|\s.*$\)"lc=4 contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell syn match dosbatchComment "\s@rem\($\|\s.*$\)"lc=5 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell -syn match dosbatchComment "\s*:\s*:.*$" contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell +if exists("dosbatch_colons_comment") + syn match dosbatchComment "\s*:\s*:.*$" contains=dosbatchTodo,dosbatchSpecialChar,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell +else + syn match dosbatchError "\s*:\s*:.*$" +endif " Comments in ()'s - still to handle spaces before rem syn match dosbatchComment "(rem\([^)]\|\^\@<=)\)*"lc=4 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument,@Spell @@ -110,34 +114,35 @@ syn keyword dosbatchImplicit vol xcopy " Define the default highlighting. " Only when an item doesn't have highlighting yet -hi def link dosbatchTodo Todo +hi def link dosbatchTodo Todo +hi def link dosbatchError Error hi def link dosbatchStatement Statement hi def link dosbatchCommands dosbatchStatement -hi def link dosbatchLabel Label +hi def link dosbatchLabel Label hi def link dosbatchConditional Conditional -hi def link dosbatchRepeat Repeat +hi def link dosbatchRepeat Repeat -hi def link dosbatchOperator Operator -hi def link dosbatchEchoOperator dosbatchOperator -hi def link dosbatchIfOperator dosbatchOperator +hi def link dosbatchOperator Operator +hi def link dosbatchEchoOperator dosbatchOperator +hi def link dosbatchIfOperator dosbatchOperator hi def link dosbatchArgument Identifier -hi def link dosbatchIdentifier Identifier +hi def link dosbatchIdentifier Identifier hi def link dosbatchVariable dosbatchIdentifier hi def link dosbatchSpecialChar SpecialChar -hi def link dosbatchString String -hi def link dosbatchNumber Number +hi def link dosbatchString String +hi def link dosbatchNumber Number hi def link dosbatchInteger dosbatchNumber hi def link dosbatchHex dosbatchNumber -hi def link dosbatchBinary dosbatchNumber -hi def link dosbatchOctal dosbatchNumber +hi def link dosbatchBinary dosbatchNumber +hi def link dosbatchOctal dosbatchNumber hi def link dosbatchComment Comment hi def link dosbatchImplicit Function -hi def link dosbatchSwitch Special +hi def link dosbatchSwitch Special hi def link dosbatchCmd PreProc diff --git a/runtime/syntax/fish.vim b/runtime/syntax/fish.vim new file mode 100644 index 0000000000..266878bbdc --- /dev/null +++ b/runtime/syntax/fish.vim @@ -0,0 +1,225 @@ +" Vim syntax file +" Language: fish +" Maintainer: Nicholas Boyle (github.com/nickeb96) +" Repository: https://github.com/nickeb96/fish.vim +" Last Change: February 1, 2023 + +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + + +" Statements +syn cluster fishStatement contains=fishKeywordAndOr,fishNot,fishSelectStatement,fishKeyword,fishKeywordIf,fishCommand,fishVariable + +syn keyword fishKeywordAndOr and or nextgroup=fishNot,fishSelectStatement,fishKeyword,fishKeywordIf,fishCommand +hi def link fishKeywordAndOr fishOperator + +syn keyword fishNot not skipwhite nextgroup=fishSelectStatement,fishKeyword,fishKeywordIf,fishCommand +syn match fishNot /!/ skipwhite nextgroup=fishSelectStatement,fishKeyword,fishKeywordIf,fishCommand +hi def link fishNot fishOperator + +syn keyword fishSelectStatement command builtin skipwhite nextgroup=fishKeyword,fishKeywordIf,fishCommand,fishOption +hi def link fishSelectStatement fishKeyword + +syn keyword fishKeyword end skipwhite nextgroup=@fishTerminator + +syn keyword fishKeywordIf if skipwhite nextgroup=@fishStatement +syn keyword fishKeyword else skipwhite nextgroup=fishKeywordIf,fishSemicolon +hi def link fishKeywordIf fishKeyword + +syn keyword fishKeyword switch skipwhite nextgroup=@fishArgument +syn keyword fishKeyword case skipwhite nextgroup=@fishArgument + +syn keyword fishKeyword while skipwhite nextgroup=@fishStatement + +syn keyword fishKeyword for skipwhite nextgroup=fishForVariable +syn match fishForVariable /[[:alnum:]_]\+/ contained skipwhite nextgroup=fishKeywordIn +syn keyword fishKeywordIn in contained skipwhite nextgroup=@fishArgument +hi def link fishForVariable fishParameter +hi def link fishKeywordIn fishKeyword + +syn keyword fishKeyword _ abbr argparse begin bg bind block break breakpoint cd commandline + \ complete continue count disown echo emit eval exec exit false fg function functions + \ history jobs math printf pwd random read realpath return set set_color source status + \ string test time true type ulimit wait + \ skipwhite nextgroup=@fishNext +syn match fishKeyword /\<contains\>/ skipwhite nextgroup=@fishNext + +syn match fishCommand /[[:alnum:]_\/[][[:alnum:]+._-]*/ skipwhite nextgroup=@fishNext + + +" Internally Nested Arguments + +syn cluster fishSubscriptArgs contains=fishInnerVariable,fishIndexNum,fishIndexRange,fishInnerCommandSub + +syn match fishInnerVariable /\$\+[[:alnum:]_]\+/ contained +syn match fishInnerVariable /\$\+[[:alnum:]_]\+\[/me=e-1,he=e-1 contained nextgroup=fishInnerSubscript +hi def link fishInnerVariable fishVariable + +syn region fishInnerSubscript matchgroup=fishVariable start=/\[/ end=/]/ contained + \ keepend contains=@fishSubscriptArgs +hi def link fishInnerSubscript fishSubscript + +syn match fishIndexNum /[+-]?[[:digit:]]\+/ contained +hi def link fishIndexNum fishParameter + +syn match fishIndexRange /\.\./ contained +hi def link fishIndexRange fishParameter + +syn region fishInnerCommandSub matchgroup=fishOperator start=/(/ start=/\$(/ end=/)/ contained + \ contains=@fishStatement +hi def link fishInnerCommandSub fishCommandSub + +syn region fishQuotedCommandSub matchgroup=fishOperator start=/\$(/ end=/)/ contained + \ contains=@fishStatement +hi def link fishQuotedCommandSub fishCommandSub + +syn match fishBraceExpansionComma /,/ contained +hi def link fishBraceExpansionComma fishOperator + +syn match fishBracedParameter '[[:alnum:]\u5b\u5d@:=+.%/!_-]\+' contained contains=fishInnerPathGlob +hi def link fishBracedParameter fishParameter + +syn region fishBracedQuote start=/'/ skip=/\\'/ end=/'/ contained + \ contains=fishEscapedEscape,fishEscapedSQuote +syn region fishBracedQuote start=/"/ skip=/\\"/ end=/"/ contained + \ contains=fishEscapedEscape,fishEscapedDQuote,fishEscapedDollar,fishInnerVariable,fishInnerCommandSub +hi def link fishBracedQuote fishQuote + + +" Arguments + +syn cluster fishArgument contains=fishParameter,fishOption,fishVariable,fishPathGlob,fishBraceExpansion,fishQuote,fishCharacter,fishCommandSub,fishRedirection,fishSelfPid + +syn match fishParameter '[[:alnum:]\u5b\u5d@:=+.,%/!_-]\+' contained skipwhite nextgroup=@fishNext + +syn match fishOption /-[[:alnum:]=_-]*/ contained skipwhite nextgroup=@fishNext + +syn match fishPathGlob /\(\~\|*\|?\)/ contained skipwhite nextgroup=@fishNext + +syn region fishBraceExpansion matchgroup=fishOperator start=/{/ end=/}/ contained + \ contains=fishBraceExpansionComma,fishInnerVariable,fishInnerCommandSub,fishBracedParameter,fishBracedQuote + \ skipwhite nextgroup=@fishNext + +syn match fishVariable /\$\+[[:alnum:]_]\+/ skipwhite nextgroup=@fishNext +syn match fishVariable /\$\+[[:alnum:]_]\+\[/me=e-1,he=e-1 nextgroup=fishSubscript + +syn region fishSubscript matchgroup=fishVariable start=/\[/ end=/]/ contained + \ keepend contains=@fishSubscriptArgs + \ skipwhite nextgroup=@fishNext + +syn region fishCommandSub matchgroup=fishOperator start=/(/ start=/\$(/ end=/)/ contained + \ contains=@fishStatement + \ skipwhite nextgroup=@fishNext + +syn region fishQuote start=/'/ skip=/\\'/ end=/'/ contained + \ contains=fishEscapedEscape,fishEscapedSQuote + \ skipwhite nextgroup=@fishNext +syn region fishQuote start=/"/ skip=/\\"/ end=/"/ contained + \ contains=fishEscapedEscape,fishEscapedDQuote,fishEscapedDollar,fishInnerVariable,fishQuotedCommandSub + \ skipwhite nextgroup=@fishNext + +syn match fishEscapedEscape /\\\\/ contained +syn match fishEscapedSQuote /\\'/ contained +syn match fishEscapedDQuote /\\"/ contained +syn match fishEscapedDollar /\\\$/ contained +hi def link fishEscapedEscape fishCharacter +hi def link fishEscapedSQuote fishCharacter +hi def link fishEscapedDQuote fishCharacter +hi def link fishEscapedDollar fishCharacter + +syn match fishCharacter /\\[0-7]\{1,3}/ contained skipwhite nextgroup=@fishNext +syn match fishCharacter /\\u[0-9a-fA-F]\{4}/ contained skipwhite nextgroup=@fishNext +syn match fishCharacter /\\U[0-9a-fA-F]\{8}/ contained skipwhite nextgroup=@fishNext +syn match fishCharacter /\\x[0-7][0-9a-fA-F]\|\\x[0-9a-fA-F]/ contained skipwhite nextgroup=@fishNext +syn match fishCharacter /\\X[0-9a-fA-F]\{1,2}/ contained skipwhite nextgroup=@fishNext +syn match fishCharacter /\\[abcefnrtv[\](){}<>\\*?~%#$|&;'" ]/ contained skipwhite nextgroup=@fishNext + +syn match fishRedirection /</ contained skipwhite nextgroup=fishRedirectionTarget +syn match fishRedirection /[0-9&]\?>[>?]\?/ contained skipwhite nextgroup=fishRedirectionTarget +syn match fishRedirection /[0-9&]\?>&[0-9-]/ contained skipwhite nextgroup=@fishNext + +syn match fishRedirectionTarget /[[:alnum:]$~*?{,}"'\/._-]\+/ contained contains=fishInnerVariable skipwhite nextgroup=@fishNext +hi def link fishRedirectionTarget fishRedirection + +syn match fishSelfPid /%self\>/ contained nextgroup=@fishNext +hi def link fishSelfPid fishOperator + + +" Terminators + +syn cluster fishTerminator contains=fishPipe,fishBackgroundJob,fishSemicolon,fishSymbolicAndOr + +syn match fishPipe /\(1>\|2>\|&\)\?|/ contained skipwhite nextgroup=@fishStatement +hi def link fishPipe fishEnd + +syn match fishBackgroundJob /&$/ contained skipwhite nextgroup=@fishStatement +syn match fishBackgroundJob /&[^<>&|]/me=s+1,he=s+1 contained skipwhite nextgroup=@fishStatement +hi def link fishBackgroundJob fishEnd + +syn match fishSemicolon /;/ skipwhite nextgroup=@fishStatement +hi def link fishSemicolon fishEnd + +syn match fishSymbolicAndOr /\(&&\|||\)/ contained skipwhite skipempty nextgroup=@fishStatement +hi def link fishSymbolicAndOr fishOperator + + +" Other + +syn cluster fishNext contains=fishEscapedNl,@fishArgument,@fishTerminator + +syn match fishEscapedNl /\\$/ skipnl skipwhite contained nextgroup=@fishNext + +syn match fishComment /#.*/ contains=fishTodo,@Spell + +syn keyword fishTodo TODO contained + + + +syn sync minlines=200 +syn sync maxlines=300 + + +" Intermediate highlight groups matching $fish_color_* variables + +hi def link fishCommand fish_color_command +hi def link fishComment fish_color_comment +hi def link fishEnd fish_color_end +hi def link fishCharacter fish_color_escape +hi def link fishKeyword fish_color_keyword +hi def link fishEscapedNl fish_color_normal +hi def link fishOperator fish_color_operator +hi def link fishVariable fish_color_operator +hi def link fishInnerVariable fish_color_operator +hi def link fishPathGlob fish_color_operator +hi def link fishOption fish_color_option +hi def link fishParameter fish_color_param +hi def link fishQuote fish_color_quote +hi def link fishRedirection fish_color_redirection + + +" Default highlight groups + +hi def link fish_color_param Normal +hi def link fish_color_normal Normal +hi def link fish_color_option Normal +hi def link fish_color_command Function +hi def link fish_color_keyword Keyword +hi def link fish_color_end Delimiter +hi def link fish_color_operator Operator +hi def link fish_color_redirection Type +hi def link fish_color_quote String +hi def link fish_color_escape Character +hi def link fish_color_comment Comment + +hi def link fishTodo Todo + + +let b:current_syntax = 'fish' + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/syntax/fstab.vim b/runtime/syntax/fstab.vim index 7e18c267f7..91150bc37b 100644 --- a/runtime/syntax/fstab.vim +++ b/runtime/syntax/fstab.vim @@ -2,8 +2,8 @@ " Language: fstab file " Maintainer: Radu Dineiu <radu.dineiu@gmail.com> " URL: https://raw.github.com/rid9/vim-fstab/master/syntax/fstab.vim -" Last Change: 2022 Dec 11 -" Version: 1.6.2 +" Last Change: 2023 Feb 19 +" Version: 1.6.3 " " Credits: " David Necas (Yeti) <yeti@physics.muni.cz> @@ -389,7 +389,7 @@ syn match fsFreqPassNumber /\d\+\s\+[012]\s*/ contained syn match fsDevice /^\s*\zs.\{-1,}\s/me=e-1 nextgroup=fsMountPoint contains=@fsDeviceCluster,@fsGeneralCluster syn match fsMountPoint /\s\+.\{-}\s/me=e-1 nextgroup=fsType contains=@fsMountPointCluster,@fsGeneralCluster contained syn match fsType /\s\+.\{-}\s/me=e-1 nextgroup=fsOptions contains=@fsTypeCluster,@fsGeneralCluster contained -syn match fsOptions /\s\+.\{-}\s/me=e-1 nextgroup=fsFreqPass contains=@fsOptionsCluster,@fsGeneralCluster contained +syn match fsOptions /\s\+.\{-}\%(\s\|$\)/ nextgroup=fsFreqPass contains=@fsOptionsCluster,@fsGeneralCluster contained syn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster contained " Whole line comments @@ -491,4 +491,4 @@ let b:current_syntax = "fstab" let &cpo = s:cpo_save unlet s:cpo_save -" vim: ts=8 ft=vim +" vim: ts=8 noet ft=vim diff --git a/runtime/syntax/go.vim b/runtime/syntax/go.vim index 904c8ad7f2..bf967fdcd9 100644 --- a/runtime/syntax/go.vim +++ b/runtime/syntax/go.vim @@ -5,7 +5,7 @@ " go.vim: Vim syntax file for Go. " Language: Go " Maintainer: Billie Cleek <bhcleek@gmail.com> -" Latest Revision: 2022-11-17 +" Latest Revision: 2023-02-19 " License: BSD-style. See LICENSE file in source repository. " Repository: https://github.com/fatih/vim-go @@ -136,8 +136,11 @@ syn keyword goBoolean true false syn keyword goPredefinedIdentifiers nil iota hi def link goBuiltins Identifier +hi def link goPredefinedIdentifiers Constant +" Boolean links to Constant by default by vim: goBoolean and goPredefinedIdentifiers +" will be highlighted the same, but having the separate groups allows users to +" have separate highlighting for them if they desire. hi def link goBoolean Boolean -hi def link goPredefinedIdentifiers goBoolean " Comments; their contents syn keyword goTodo contained TODO FIXME XXX BUG diff --git a/runtime/syntax/html.vim b/runtime/syntax/html.vim index 605db3ae1c..82c829a2e1 100644 --- a/runtime/syntax/html.vim +++ b/runtime/syntax/html.vim @@ -3,7 +3,7 @@ " Maintainer: Doug Kearns <dougkearns@gmail.com> " Previous Maintainers: Jorge Maldonado Ventura <jorgesumle@freakspot.net> " Claudio Fleiner <claudio@fleiner.com> -" Last Change: 2022 Nov 18 +" Last Change: 2023 Feb 20 " Please check :help html.vim for some comments and a description of the options @@ -221,7 +221,7 @@ if main_syntax != 'java' || exists("java_javascript") " JAVA SCRIPT syn include @htmlJavaScript syntax/javascript.vim unlet b:current_syntax - syn region javaScript start=+<script\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc + syn region javaScript start=+<script\>\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc syn region htmlScriptTag contained start=+<script+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent hi def link htmlScriptTag htmlTag diff --git a/runtime/syntax/poefilter.vim b/runtime/syntax/poefilter.vim index f7e92034ee..6561f7a704 100644 --- a/runtime/syntax/poefilter.vim +++ b/runtime/syntax/poefilter.vim @@ -2,7 +2,7 @@ " Language: PoE item filter " Maintainer: ObserverOfTime <chronobserver@disroot.org> " Filenames: *.filter -" Last Change: 2022 Oct 07 +" Last Change: 2023 Feb 10 if exists('b:current_syntax') finish @@ -17,7 +17,7 @@ syn match poefilterCommentTag /\[[0-9A-Z\[\]]\+\]/ contained syn match poefilterComment /#.*$/ contains=poefilterTodo,poefilterCommentTag,@Spell " Blocks -syn keyword poefilterBlock Show Hide +syn keyword poefilterBlock Show Hide Minimal " Conditions syn keyword poefilterCondition |