From: Doug Kearns Date: Wed, 21 Jan 2026 20:23:06 +0000 (+0000) Subject: runtime(csh,tcsh): Update syntax files X-Git-Tag: v9.1.2104~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95bb4ef7d1b07591ae1a7d3616432bbbe6858dd1;p=thirdparty%2Fvim.git runtime(csh,tcsh): Update syntax files - Adopt csh syntax file. - Highlight tcsh strings with the String highlight group. - Fix 'set' command highlighting with trailing comments. See https://github.com/vim/vim/pull/19172#issuecomment-3751574224 - Fix whitespace style in MAINTAINERS file closes: #19191 Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS index 11bbc17524..f5767bf52e 100644 --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -3,7 +3,7 @@ # You can use github users with @user or email addresses # These owners will be the default owners for everything in the repo. -#* @brammool +#* @brammool # Order is important. The last matching pattern has the most precedence. # So if a pull request only touches javascript files, only these owners @@ -14,7 +14,7 @@ runtime/autoload/context.vim @lifepillar runtime/autoload/freebasic.vim @dkearns runtime/autoload/hare.vim @selenebun runtime/autoload/hcl.vim @gpanders -runtime/autoload/javascriptcomplete.vim @jsit +runtime/autoload/javascriptcomplete.vim @jsit runtime/autoload/modula2.vim @dkearns runtime/autoload/rubycomplete.vim @segfault @dkearns runtime/autoload/rust.vim @lilyball @@ -132,7 +132,7 @@ runtime/ftplugin/autohotkey.vim @telemachus runtime/ftplugin/awk.vim @dkearns runtime/ftplugin/basic.vim @dkearns runtime/ftplugin/bicep.vim @scottmckendry -runtime/ftplugin/bicep-params.vim @scottmckendry +runtime/ftplugin/bicep-params.vim @scottmckendry runtime/ftplugin/brighterscript.vim @ribru17 runtime/ftplugin/brightscript.vim @ribru17 runtime/ftplugin/bst.vim @tpope @@ -224,7 +224,7 @@ runtime/ftplugin/julia.vim @carlobaldassi runtime/ftplugin/just.vim @pbnj runtime/ftplugin/kconfig.vim @chrisbra runtime/ftplugin/kdl.vim @imsnif @jiangyinzuo -runtime/ftplugin/kerml.vim @daumantas-kavolis-sensmetry +runtime/ftplugin/kerml.vim @daumantas-kavolis-sensmetry runtime/ftplugin/kitty.vim @rivenirvana runtime/ftplugin/kivy.vim @ribru17 runtime/ftplugin/kotlin.vim @udalov @@ -236,8 +236,8 @@ runtime/ftplugin/less.vim @genoma runtime/ftplugin/lex.vim @ribru17 runtime/ftplugin/lf.vim @andis-sprinkis runtime/ftplugin/liquid.vim @tpope -runtime/ftplugin/logtalk.dict @pmoura -runtime/ftplugin/logtalk.vim @pmoura +runtime/ftplugin/logtalk.dict @pmoura +runtime/ftplugin/logtalk.vim @pmoura runtime/ftplugin/lua.vim @dkearns runtime/ftplugin/lynx.vim @dkearns runtime/ftplugin/m17ndb.vim @dseomn @@ -247,11 +247,11 @@ runtime/ftplugin/markdown.vim @tpope runtime/ftplugin/mbsync.vim @fymyte runtime/ftplugin/mediawiki.vim @avidseeker runtime/ftplugin/meson.vim @Liambeguin -runtime/ftplugin/mf.vim @lifepillar +runtime/ftplugin/mf.vim @lifepillar runtime/ftplugin/modula2.vim @dkearns runtime/ftplugin/modula3.vim @dkearns runtime/ftplugin/mojo.vim @ribru17 -runtime/ftplugin/mp.vim @lifepillar +runtime/ftplugin/mp.vim @lifepillar runtime/ftplugin/mss.vim @Freed-Wu runtime/ftplugin/nginx.vim @chr4 runtime/ftplugin/nim.vim @ribru17 @@ -261,7 +261,7 @@ runtime/ftplugin/nu.vim @elkasztano runtime/ftplugin/octave.vim @dkearns runtime/ftplugin/ondir.vim @jparise runtime/ftplugin/opencl.vim @Freed-Wu -runtime/ftplugin/openscad.vim @squibid +runtime/ftplugin/openscad.vim @squibid runtime/ftplugin/openvpn.vim @ObserverOfTime runtime/ftplugin/pascal.vim @dkearns runtime/ftplugin/pbtxt.vim @lakshayg @@ -315,7 +315,7 @@ runtime/ftplugin/sshdconfig.vim @jiangyinzuo runtime/ftplugin/svelte.vim @igorlfs runtime/ftplugin/sway.vim @ribru17 runtime/ftplugin/swayconfig.vim @jamespeapen -runtime/ftplugin/sysml.vim @daumantas-kavolis-sensmetry +runtime/ftplugin/sysml.vim @daumantas-kavolis-sensmetry runtime/ftplugin/systemverilog.vim @Kocha runtime/ftplugin/swig.vim @jmarrec runtime/ftplugin/tap.vim @petdance @@ -401,10 +401,10 @@ runtime/indent/lua.vim @marcuscf runtime/indent/m17ndb.vim @dseomn runtime/indent/make.vim @dkearns runtime/indent/meson.vim @Liambeguin -runtime/indent/mf.vim @lifepillar +runtime/indent/mf.vim @lifepillar runtime/indent/mma.vim @dkearns runtime/indent/mojo.vim @ribru17 -runtime/indent/mp.vim @lifepillar +runtime/indent/mp.vim @lifepillar runtime/indent/nginx.vim @chr4 runtime/indent/nsis.vim @k-takata runtime/indent/nu.vim @elkasztano @@ -487,6 +487,7 @@ runtime/syntax/clojure.vim @axvr runtime/syntax/codeowners.vim @jparise runtime/syntax/context.vim @lifepillar runtime/syntax/cs.vim @nickspoons +runtime/syntax/csh.vim @dkearns runtime/syntax/css.vim @jsit runtime/syntax/csv.vim @habamax runtime/syntax/cucumber.vim @tpope @@ -592,13 +593,13 @@ runtime/syntax/mbsync.vim @fymyte runtime/syntax/mason.vim @petdance runtime/syntax/mediawiki.vim @avidseeker runtime/syntax/meson.vim @Liambeguin -runtime/syntax/mf.vim @lifepillar +runtime/syntax/mf.vim @lifepillar runtime/syntax/modula2.vim @dkearns runtime/syntax/modula2/opt/iso.vim @trijezdci runtime/syntax/modula2/opt/pim.vim @trijezdci runtime/syntax/modula2/opt/r10.vim @trijezdci runtime/syntax/modula3.vim @dkearns -runtime/syntax/mp.vim @lifepillar +runtime/syntax/mp.vim @lifepillar runtime/syntax/mss.vim @Freed-Wu runtime/syntax/n1ql.vim @pr3d4t0r runtime/syntax/nginx.vim @chr4 diff --git a/runtime/syntax/csh.vim b/runtime/syntax/csh.vim index 0ad85adfc7..cf1c68d65f 100644 --- a/runtime/syntax/csh.vim +++ b/runtime/syntax/csh.vim @@ -1,10 +1,8 @@ " Vim syntax file -" Language: C-shell (csh) -" Maintainer: This runtime file is looking for a new maintainer. -" Former Maintainer: Charles E. Campbell -" Last Change: Aug 31, 2016 -" Version: 14 -" Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_CSH +" Language: C-shell (csh) +" Maintainer: Doug Kearns +" Former Maintainer: Charles E. Campbell +" Last Change: 2026 Jan 16 " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -40,7 +38,7 @@ syn region cshDblQuote start=+^"+ skip=+\\\\\|\\"+ end=+"+ contains=cshSpecial syn region cshSnglQuote start=+^'+ skip=+\\\\\|\\'+ end=+'+ contains=cshNoEndlineSQ,@Spell syn region cshBckQuote start=+^`+ skip=+\\\\\|\\`+ end=+`+ contains=cshNoEndlineBQ,@Spell syn cluster cshCommentGroup contains=cshTodo,@Spell -syn match cshComment "#.*$" contains=@cshCommentGroup +syn match cshComment "#.*" contains=@cshCommentGroup " A bunch of useful csh keywords syn keyword cshStatement alias end history onintr setenv unalias diff --git a/runtime/syntax/tcsh.vim b/runtime/syntax/tcsh.vim index 6837125129..70265e2910 100644 --- a/runtime/syntax/tcsh.vim +++ b/runtime/syntax/tcsh.vim @@ -2,7 +2,7 @@ " Language: tcsh scripts " Maintainer: Doug Kearns " Previous Maintainer: Gautam Iyer where NoSpam=gmail (Original Author) -" Last Change: 2021 Oct 15 +" Last Change: 2026 Jan 16 " Description: We break up each statement into a "command" and an "end" part. " All groups are either a "command" or part of the "end" of a statement (ie @@ -129,11 +129,12 @@ syn match tcshExprEnd contained '\v.*$'hs=e+1 contains=@tcshConditions syn match tcshExprEnd contained '\v.{-};'hs=e contains=@tcshConditions " ----- Comments: ----- {{{1 -syn match tcshComment '#\s.*' contains=tcshTodo,tcshCommentTi,@Spell -syn match tcshComment '\v#($|\S.*)' contains=tcshTodo,tcshCommentTi -syn match tcshSharpBang '^#! .*$' -syn match tcshCommentTi contained '\v#\s*\u\w*(\s+\u\w*)*:'hs=s+1 contains=tcshTodo -syn match tcshTodo contained '\v\c' +syn match tcshSharpBang '\%^#!.*$' +syn match tcshComment '#.*' contains=tcshTodo,@Spell +syn match tcshTodo contained '\v%(^\s*#\s*)@<=\c<%(TODO|FIXME|XXX)>' + +" TODO: leading whitespace match is needed to prevent keyword matching +syn match tcshLabel '^\s*\w\+:\ze\s*$' " ----- Strings ----- {{{1 " Tcsh does not allow \" in strings unless the "backslash_quote" shell @@ -141,14 +142,14 @@ syn match tcshTodo contained '\v\c' " want VIM to assume that no backslash quote constructs exist. " Backquotes are treated as commands, and are not contained in anything -if exists('tcsh_backslash_quote') && tcsh_backslash_quote == 0 - syn region tcshSQuote keepend contained start="\v\\@\>?\&?!?' syn match tcshMeta contained '\v[]{}*?[]' " Here documents (<<) -syn region tcshHereDoc contained matchgroup=tcshShellVar start='\v\<\<\s*\z(\h\w*)' end='^\z1$' contains=@tcshVarList,tcshSpecial -syn region tcshHereDoc contained matchgroup=tcshShellVar start="\v\<\<\s*'\z(\h\w*)'" start='\v\<\<\s*"\z(\h\w*)"$' start='\v\<\<\s*\\\z(\h\w*)$' end='^\z1$' +syn region tcshHereDoc contained matchgroup=tcshShellVar start='\v\<\<\s*\z(\h\w*)' end='^\z1$' contains=@tcshVarList,tcshSpecial fold +syn region tcshHereDoc contained matchgroup=tcshShellVar start="\v\<\<\s*'\z(\h\w*)'" start='\v\<\<\s*"\z(\h\w*)"$' start='\v\<\<\s*\\\z(\h\w*)$' end='^\z1$' fold " Operators syn match tcshOperator contained '&&\|!\~\|!=\|<<\|<=\|==\|=\~\|>=\|>>\|\*\|\^\|\~\|||\|!\|%\|&\|+\|-\|/\|<\|>\||' @@ -226,10 +227,9 @@ hi def link tcshExprVar tcshUsrVar hi def link tcshExprOp tcshOperator hi def link tcshExprEnd tcshOperator hi def link tcshComment Comment -hi def link tcshCommentTi Preproc -hi def link tcshSharpBang tcshCommentTi +hi def link tcshSharpBang PreProc hi def link tcshTodo Todo -hi def link tcshSQuote Constant +hi def link tcshSQuote String hi def link tcshDQuote tcshSQuote hi def link tcshBQuoteGrp Include hi def link tcshVarError Error @@ -245,6 +245,7 @@ hi def link tcshOperator Operator hi def link tcshNumber Number hi def link tcshArgument Special hi def link tcshSpecial SpecialChar +hi def link tcshLabel Label " }}} let &cpo = s:oldcpo diff --git a/runtime/syntax/testdir/dumps/csh_00.dump b/runtime/syntax/testdir/dumps/csh_00.dump new file mode 100644 index 0000000000..cea28cef63 --- /dev/null +++ b/runtime/syntax/testdir/dumps/csh_00.dump @@ -0,0 +1,20 @@ +>#+0#0000e05#ffffff0| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|v|i|m|/|v|i|m|/|p|u|l@1|/|1|9|1|7|2|#|i|s@1|u|e|c|o|m@1|e|n|t|-|3|7|5|1|5|7|4|2@1|4| +0#0000000&@11 +@75 +|s+0#af5f00255&|e|t| +0#0000000&|s|c|r|i|p|t|_|d|i|r|=|"+0#e000002&@1| +0#0000000&|#+0#0000e05&|c|o|m@1|e|n|t| +0#0000000&@48 +|s+0#af5f00255&|e|t| +0#0000000&|s|c|r|i|p|t|_|d|i|r|=|"+0#e000002&@1| +0#0000000&@57 +|s+0#af5f00255&|e|t| +0#0000000&|s|c|r|i|p|t|_|d|i|r|=|"+0#e000002&@1| +0#0000000&|#+0#0000e05&| +0#0000000&@55 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/tcsh_00.dump b/runtime/syntax/testdir/dumps/tcsh_00.dump new file mode 100644 index 0000000000..cea28cef63 --- /dev/null +++ b/runtime/syntax/testdir/dumps/tcsh_00.dump @@ -0,0 +1,20 @@ +>#+0#0000e05#ffffff0| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|v|i|m|/|v|i|m|/|p|u|l@1|/|1|9|1|7|2|#|i|s@1|u|e|c|o|m@1|e|n|t|-|3|7|5|1|5|7|4|2@1|4| +0#0000000&@11 +@75 +|s+0#af5f00255&|e|t| +0#0000000&|s|c|r|i|p|t|_|d|i|r|=|"+0#e000002&@1| +0#0000000&|#+0#0000e05&|c|o|m@1|e|n|t| +0#0000000&@48 +|s+0#af5f00255&|e|t| +0#0000000&|s|c|r|i|p|t|_|d|i|r|=|"+0#e000002&@1| +0#0000000&@57 +|s+0#af5f00255&|e|t| +0#0000000&|s|c|r|i|p|t|_|d|i|r|=|"+0#e000002&@1| +0#0000000&|#+0#0000e05&| +0#0000000&@55 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/input/csh.csh b/runtime/syntax/testdir/input/csh.csh new file mode 100644 index 0000000000..332b626e52 --- /dev/null +++ b/runtime/syntax/testdir/input/csh.csh @@ -0,0 +1,6 @@ +# https://github.com/vim/vim/pull/19172#issuecomment-3751574224 + +set script_dir="" #comment +set script_dir="" +set script_dir="" # + diff --git a/runtime/syntax/testdir/input/tcsh.tcsh b/runtime/syntax/testdir/input/tcsh.tcsh new file mode 100644 index 0000000000..332b626e52 --- /dev/null +++ b/runtime/syntax/testdir/input/tcsh.tcsh @@ -0,0 +1,6 @@ +# https://github.com/vim/vim/pull/19172#issuecomment-3751574224 + +set script_dir="" #comment +set script_dir="" +set script_dir="" # +