diff options
-rw-r--r-- | runtime/compiler/shellcheck.vim | 25 | ||||
-rw-r--r-- | runtime/doc/autocmd.txt | 2 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 2 | ||||
-rw-r--r-- | runtime/doc/filetype.txt | 7 | ||||
-rw-r--r-- | runtime/doc/gui.txt | 40 | ||||
-rw-r--r-- | runtime/filetype.vim | 2 | ||||
-rw-r--r-- | runtime/ftplugin/awk.vim | 41 | ||||
-rw-r--r-- | runtime/indent/vim.vim | 8 | ||||
-rw-r--r-- | runtime/syntax/sh.vim | 52 | ||||
-rw-r--r-- | runtime/syntax/vim.vim | 18 |
10 files changed, 148 insertions, 49 deletions
diff --git a/runtime/compiler/shellcheck.vim b/runtime/compiler/shellcheck.vim new file mode 100644 index 0000000000..7550439aa2 --- /dev/null +++ b/runtime/compiler/shellcheck.vim @@ -0,0 +1,25 @@ +" Vim compiler file +" Compiler: ShellCheck +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2020 Sep 4 + +if exists("current_compiler") + finish +endif +let current_compiler = "shellcheck" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=shellcheck\ -f\ gcc +CompilerSet errorformat=%f:%l:%c:\ %trror:\ %m\ [SC%n], + \%f:%l:%c:\ %tarning:\ %m\ [SC%n], + \%f:%l:%c:\ %tote:\ %m\ [SC%n], + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 146f5bb533..6619449d91 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -463,7 +463,7 @@ CompleteDone After Insert mode completion is done. Either *CursorHold* CursorHold When the user doesn't press a key for the time - specified with 'updatetime'. Not re-triggered + specified with 'updatetime'. Not triggered until the user has pressed a key (i.e. doesn't fire every 'updatetime' ms if you leave Vim to make some coffee. :) See |CursorHold-example| diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 9f2a3a0956..f41c499f88 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -693,7 +693,7 @@ Example: > All expressions within one level are parsed from left to right. -expr1 *expr1* *E109* +expr1 *expr1* *trinary* *E109* ----- expr2 ? expr1 : expr1 diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index c853fca036..c39ccf90f8 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -353,6 +353,13 @@ ways to change this: 3. Docs for the default filetype plugins. *ftplugin-docs* +AWK *ft-awk-plugin* + +Support for features specific to GNU Awk, like @include, can be enabled by +setting: > + let g:awk_is_gawk = 1 + + CHANGELOG *ft-changelog-plugin* Allows for easy entrance of Changelog entries in Changelog files. There are diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index 1658868a50..c95311edca 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -180,14 +180,6 @@ This does require the |+menu| feature enabled at compile time. Creating New Menus *creating-menus* *:me* *:menu* *:noreme* *:noremenu* - *:am* *:amenu* *:an* *:anoremenu* - *:nme* *:nmenu* *:nnoreme* *:nnoremenu* - *:ome* *:omenu* *:onoreme* *:onoremenu* - *:vme* *:vmenu* *:vnoreme* *:vnoremenu* - *:xme* *:xmenu* *:xnoreme* *:xnoremenu* - *:sme* *:smenu* *:snoreme* *:snoremenu* - *:ime* *:imenu* *:inoreme* *:inoremenu* - *:cme* *:cmenu* *:cnoreme* *:cnoremenu* *E330* *E327* *E331* *E336* *E333* *E328* *E329* *E337* *E792* To create a new menu item, use the ":menu" commands. They are mostly like @@ -222,6 +214,7 @@ With the shortcut "F" (while keeping the <Alt> key pressed), and then "O", this menu can be used. The second part is shown as "Open :e". The ":e" is right aligned, and the "O" is underlined, to indicate it is the shortcut. + *:am* *:amenu* *:an* *:anoremenu* The ":amenu" command can be used to define menu entries for all modes at once. To make the command work correctly, a character is automatically inserted for some modes: @@ -257,6 +250,30 @@ expression register: > Note that <Esc> in Cmdline mode executes the command, like in a mapping. This is Vi compatible. Use CTRL-C to quit Cmdline mode. + *:nme* *:nmenu* *:nnoreme* *:nnoremenu* *:nunme* *:nunmenu* +Menu commands starting with "n" work in Normal mode. |mapmode-n| + + *:ome* *:omenu* *:onoreme* *:onoremenu* *:ounme* *:ounmenu* +Menu commands starting with "o" work in Operator-pending mode. |mapmode-o| + + *:vme* *:vmenu* *:vnoreme* *:vnoremenu* *:vunme* *:vunmenu* +Menu commands starting with "v" work in Visual mode. |mapmode-v| + + *:xme* *:xmenu* *:xnoreme* *:xnoremenu* *:xunme* *:xunmenu* +Menu commands starting with "x" work in Visual and Select mode. |mapmode-x| + + *:sme* *:smenu* *:snoreme* *:snoremenu* *:sunme* *:sunmenu* +Menu commands starting with "s" work in Select mode. |mapmode-s| + + *:ime* *:imenu* *:inoreme* *:inoremenu* *:iunme* *:iunmenu* +Menu commands starting with "i" work in Insert mode. |mapmode-i| + + *:cme* *:cmenu* *:cnoreme* *:cnoremenu* *:cunme* *:cunmenu* +Menu commands starting with "c" work in Cmdline mode. |mapmode-c| + + *:tlm* *:tlmenu* *:tln* *:tlnoremenu* *:tlu* *:tlunmenu* +Menu commands starting with "tl" work in Terminal mode. |mapmode-t| + *:menu-<silent>* *:menu-silent* To define a menu which will not be echoed on the command line, add "<silent>" as the first argument. Example: > @@ -464,13 +481,6 @@ Deleting Menus *delete-menus* *:unme* *:unmenu* *:aun* *:aunmenu* - *:nunme* *:nunmenu* - *:ounme* *:ounmenu* - *:vunme* *:vunmenu* - *:xunme* *:xunmenu* - *:sunme* *:sunmenu* - *:iunme* *:iunmenu* - *:cunme* *:cunmenu* To delete a menu item or a whole submenu, use the unmenu commands, which are analogous to the unmap commands. Eg: > :unmenu! Edit.Paste diff --git a/runtime/filetype.vim b/runtime/filetype.vim index ff72ed5482..de1204d89a 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1230,7 +1230,7 @@ au BufNewFile,BufRead *.pod6 setf pod6 au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp setf php " PHP config -au BufNewFile,BufRead php.ini,php.ini-* setf dosini +au BufNewFile,BufRead php.ini-* setf dosini " Pike and Cmod au BufNewFile,BufRead *.pike,*.pmod setf pike diff --git a/runtime/ftplugin/awk.vim b/runtime/ftplugin/awk.vim index dcefc85ec3..9809fec383 100644 --- a/runtime/ftplugin/awk.vim +++ b/runtime/ftplugin/awk.vim @@ -1,9 +1,10 @@ " Vim filetype plugin " Language: awk, nawk, gawk, mawk " Maintainer: Antonio Colombo <azc100@gmail.com> -" Last Change: 2017 Feb 17 +" Last Change: 2020 Sep 28 " This plugin was prepared by Mark Sikora +" This plugin was updated as proposed by Doug Kearns " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -13,6 +14,42 @@ endif " Don't load another plugin for this buffer let b:did_ftplugin = 1 -let b:undo_ftplugin = "setl commentstring<" +let s:cpo_save = &cpo +set cpo&vim +setlocal comments=:# setlocal commentstring=#\ %s +setlocal formatoptions-=t formatoptions+=croql + +setlocal define=function +setlocal suffixesadd+=.awk + +let b:undo_ftplugin = "setl fo< com< cms< def< sua<" . + \ " | unlet! b:browsefilter" + +" TODO: set this in scripts.vim? +if exists("g:awk_is_gawk") + setlocal include=@include + setlocal suffixesadd+=.gawk + if has("unix") || has("win32unix") + setlocal formatprg=gawk\ -f-\ -o/dev/stdout + let b:undo_ftplugin .= " | setl fp<" + endif + + let path = system("gawk 'BEGIN { printf ENVIRON[\"AWKPATH\"] }'") + let path = substitute(path, '^\.\=:\|:\.\=$\|:\.\=:', ',,', 'g') " POSIX cwd + let path = substitute(path, ':', ',', 'g') + + let &l:path = path + let b:undo_ftplugin .= " | setl inc< path<" +endif + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Awk Source Files (*.awk,*.gawk)\t*.awk;*.gawk\n" . + \ "All Files (*.*)\t*.*\n" +endif + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 diff --git a/runtime/indent/vim.vim b/runtime/indent/vim.vim index 7b9fa734bc..1303cbab31 100644 --- a/runtime/indent/vim.vim +++ b/runtime/indent/vim.vim @@ -1,7 +1,7 @@ " Vim indent file " Language: Vim script " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2020 Jul 19 +" Last Change: 2020 Sep 27 " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -10,7 +10,7 @@ endif let b:did_indent = 1 setlocal indentexpr=GetVimIndent() -setlocal indentkeys+==end,=else,=cat,=fina,=END,0\\,0=\"\\\ +setlocal indentkeys+==end,=},=else,=cat,=finall,=END,0\\,0=\"\\\ setlocal indentkeys-=0# let b:undo_indent = "setl indentkeys< indentexpr<" @@ -93,7 +93,7 @@ function GetVimIndentIntern() else " A line starting with :au does not increment/decrement indent. if prev_text !~ '^\s*au\%[tocmd]' - let i = match(prev_text, '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>') + let i = match(prev_text, '\(^\||\)\s*\(export\s\+\)\?\({\|\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\|finall\%[y]\|fu\%[nction]\|def\|el\%[seif]\)\>\)') if i >= 0 let ind += shiftwidth() if strpart(prev_text, i, 1) == '|' && has('syntax_items') @@ -117,7 +117,7 @@ function GetVimIndentIntern() " Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry, " :endfun, :else and :augroup END. - if cur_text =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s\+[eE][nN][dD]\)' + if cur_text =~ '^\s*\(ene\@!\|}\|cat\|finall\|el\|aug\%[roup]\s\+[eE][nN][dD]\)' let ind = ind - shiftwidth() endif diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 3a2a6e7b0e..b66805633d 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,8 +2,8 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM> " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int> -" Last Change: Apr 14, 2020 -" Version: 190 +" Last Change: Aug 10, 2020 +" Version: 193 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) @@ -20,8 +20,8 @@ if getline(1) =~ '\<ksh$' elseif getline(1) =~ '\<bash$' let b:is_bash = 1 elseif getline(1) =~ '\<dash$' - let b:is_posix = 1 -elseif !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix") && !exists("g:is_sh") + let b:is_dash = 1 +elseif !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix") && !exists("g:is_sh") && !exists("g:is_dash") let s:shell = "" if executable("/bin/sh") let s:shell = resolve("/bin/sh") @@ -33,7 +33,7 @@ elseif !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix" elseif s:shell =~ 'bash$' let b:is_bash = 1 elseif s:shell =~ 'dash$' - let b:is_posix = 1 + let b:is_dash = 1 endif unlet s:shell endif @@ -45,7 +45,7 @@ endif " So, when the user sets "g:is_bash", "g:is_kornshell", " or "g:is_posix", a b:is_sh is converted into b:is_bash/b:is_kornshell, " respectively. -if !exists("b:is_kornshell") && !exists("b:is_bash") +if !exists("b:is_kornshell") && !exists("b:is_bash") && !exists("b:is_dash") if exists("g:is_posix") && !exists("g:is_kornshell") let g:is_kornshell= g:is_posix endif @@ -59,11 +59,21 @@ if !exists("b:is_kornshell") && !exists("b:is_bash") if exists("b:is_sh") unlet b:is_sh endif + elseif exists("g:is_dash") + let b:is_dash= 1 + if exists("b:is_sh") + unlet b:is_sh + endif else let b:is_sh= 1 endif endif +" if b:is_dash, set b:is_posix too +if exists("b:is_dash") + let b:is_posix= 1 +endif + " set up default g:sh_fold_enabled {{{1 " ================================ if !exists("g:sh_fold_enabled") @@ -133,7 +143,7 @@ syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefS " COMBAK: removing shEscape fromshDblQuoteList fails ksh04:43 syn cluster shDblQuoteList contains=shArithmetic,shCommandSub,shCommandSubBQ,shDeref,shDerefSimple,shPosnParm,shCtrlSeq,shSpecial,shSpecialDQ syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPSR,shDerefPPS -syn cluster shDerefVarList contains=shDerefOff,shDerefOp,shDerefVarArray,shDerefOpError +syn cluster shDerefVarList contains=shDerefOffset,shDerefOp,shDerefVarArray,shDerefOpError syn cluster shEchoList contains=shArithmetic,shCommandSub,shCommandSubBQ,shDeref,shDerefSimple,shEscape,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shDblBrace,shDeref,shDerefSimple,shCtrlSeq syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest @@ -358,7 +368,7 @@ elseif !exists("g:sh_no_error") endif syn region shSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=@Spell nextgroup=shSpecialStart,shSpecialSQ syn region shDoubleQuote matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@<!"+ skip=+\\.+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell nextgroup=shSpecialStart -syn region shDoubleQuote matchgroup=shQuote start=+"+ matchgroup=shSpecial skip=+\\"+ end=+"+ contained contains=@shDblQuoteList,shStringSpecial,@Spell nextgroup=shSpecialStart +syn region shDoubleQuote matchgroup=shQuote start=+"+ matchgroup=shSpecial skip=+\\"+ matchgroup=shQuote end=+"+ contained contains=@shDblQuoteList,shStringSpecial,@Spell nextgroup=shSpecialStart syn match shStringSpecial "[^[:print:] \t]" contained syn match shStringSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shComment syn match shSpecialSQ "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" contained nextgroup=shBkslshSnglQuote,@shNoZSList @@ -424,6 +434,9 @@ if exists("b:is_bash") syn region shSetList oneline matchgroup=shSet start="\<\%(set\|unset\)\>[/a-zA-Z_]\@!" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+=" contains=@shIdList nextgroup=shComment elseif exists("b:is_kornshell") || exists("b:is_posix") syn match shSet "^\s*set\ze\s\+$" + if exists("b:is_dash") + syn region shSetList oneline matchgroup=shSet start="\<\%(local\)\>\ze[/]\@!" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList + endif syn region shSetList oneline matchgroup=shSet start="\<\(export\)\>\ze[/]\@!" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList syn region shSetList oneline matchgroup=shSet start="\<\%(set\|unset\>\)\ze[/a-zA-Z_]\@!" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList nextgroup=shComment else @@ -471,14 +484,14 @@ endif " bash: ${!prefix*} and ${#parameter}: {{{1 " ==================================== if exists("b:is_bash") - syn region shDeref matchgroup=PreProc start="\${!" end="\*\=}" contains=@shDerefList,shDerefOff + syn region shDeref matchgroup=PreProc start="\${!" end="\*\=}" contains=@shDerefList,shDerefOffset syn match shDerefVar contained "{\@<=!\h\w*" nextgroup=@shDerefVarList endif if exists("b:is_kornshell") syn match shDerefVar contained "{\@<=!\h\w*[[:alnum:]_.]*" nextgroup=@shDerefVarList endif -syn match shDerefSpecial contained "{\@<=[-*@?0]" nextgroup=shDerefOp,shDerefOpError +syn match shDerefSpecial contained "{\@<=[-*@?0]" nextgroup=shDerefOp,shDerefOffset,shDerefOpError syn match shDerefSpecial contained "\({[#!]\)\@<=[[:alnum:]*@_]\+" nextgroup=@shDerefVarList,shDerefOp syn match shDerefVar contained "{\@<=\h\w*" nextgroup=@shDerefVarList syn match shDerefVar contained '\d' nextgroup=@shDerefVarList @@ -502,6 +515,7 @@ syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" co " bash : ${parameter^^pattern} Case modification " bash : ${parameter,pattern} Case modification " bash : ${parameter,,pattern} Case modification +" bash : ${@:start:qty} display command line arguments from start to start+qty-1 (inferred) syn cluster shDerefPatternList contains=shDerefPattern,shDerefString if !exists("g:sh_no_error") syn match shDerefOpError contained ":[[:punct:]]" @@ -522,17 +536,19 @@ syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@<!'+ syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial syn match shDerefString contained "\\["']" nextgroup=shDerefPattern -if exists("b:is_bash") - " bash : ${parameter:offset} - " bash : ${parameter:offset:length} - syn region shDerefOff contained start=':[^-=?+]' end='\ze:' end='\ze}' contains=shDeref,shDerefSimple,shDerefEscape nextgroup=shDerefLen,shDeref,shDerefSimple - syn region shDerefOff contained start=':\s-' end='\ze:' end='\ze}' contains=shDeref,shDerefSimple,shDerefEscape nextgroup=shDerefLen,shDeref,shDerefSimple +if exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix") + " bash ksh posix : ${parameter:offset} + " bash ksh posix : ${parameter:offset:length} + syn region shDerefOffset contained start=':[^-=?+]' end='\ze:' end='\ze}' contains=shDeref,shDerefSimple,shDerefEscape nextgroup=shDerefLen,shDeref,shDerefSimple + syn region shDerefOffset contained start=':\s-' end='\ze:' end='\ze}' contains=shDeref,shDerefSimple,shDerefEscape nextgroup=shDerefLen,shDeref,shDerefSimple syn match shDerefLen contained ":[^}]\+" contains=shDeref,shDerefSimple,shArithmetic +endif +if exists("b:is_bash") " bash : ${parameter//pattern/string} " bash : ${parameter//pattern} syn match shDerefPPS contained '/\{1,2}' nextgroup=shDerefPPSleft - syn region shDerefPPSleft contained start='.' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPPSright contains=@shPPSLeftList + syn region shDerefPPSleft contained start='.' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' end='"' nextgroup=shDerefPPSright contains=@shPPSLeftList syn region shDerefPPSright contained start='.' skip=@\%(\\\\\)\+@ end='\ze}' contains=@shPPSRightList " bash : ${parameter/#substring/replacement} @@ -675,8 +691,8 @@ if !exists("skip_sh_syntax_inits") hi def link bashSpecialVariables shShellVariables hi def link bashStatement shStatement hi def link shCharClass shSpecial - hi def link shDerefOff shDerefOp - hi def link shDerefLen shDerefOff + hi def link shDerefOffset shDerefOp + hi def link shDerefLen shDerefOffset endif if exists("b:is_kornshell") || exists("b:is_posix") hi def link kshSpecialVariables shShellVariables diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 0a8eaf887b..1610883b5b 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -210,7 +210,7 @@ endif " Functions : Tag is provided for those who wish to highlight tagged functions {{{2 " ========= syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID -syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLetHereDoc,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand +syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimEnvvar,vimExecute,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLetHereDoc,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand syn match vimFunction "\<fu\%[nction]!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' @@ -239,7 +239,7 @@ syn match vimSpecFileMod "\(:[phtre]\)\+" contained " ======================= syn cluster vimUserCmdList contains=vimAddress,vimSyntax,vimHighlight,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimCtrlChar,vimEscapeBrace,vimFunc,vimFuncName,vimFunction,vimFunctionError,vimIsCommand,vimMark,vimNotation,vimNumber,vimOper,vimRegion,vimRegister,vimLet,vimSet,vimSetEqual,vimSetString,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange,vimSynLine syn keyword vimUserCommand contained com[mand] -syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList +syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter syn match vimUserAttrbError contained "-\a\+\ze\s" syn match vimUserAttrb contained "-nargs=[01*?+]" contains=vimUserAttrbKey,vimOper syn match vimUserAttrb contained "-complete=" contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError @@ -268,12 +268,13 @@ syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentS syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' " Vim9 comments - TODO: might be highlighted while they don't work -syn match vim9Comment excludenl +^#[^{].*$+ contains=@vimCommentGroup,vimCommentString syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString " Vim9 comment inside expression syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString +syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString +syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString " Environment Variables: {{{2 " ===================== @@ -343,7 +344,8 @@ syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1 syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1 syn match vimFilter "^!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile -syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile +syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile +syn match vimComFilter contained "|!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile " Complex Repeats: (:h complex-repeat) {{{2 syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1 @@ -358,7 +360,7 @@ syn match vimSetMod contained "&vim\=\|[!&?<]\|all&" " Let: {{{2 " === -syn keyword vimLet let unl[et] skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc +syn keyword vimLet let var unl[et] skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s\+\%(trim\>\)\=\s*\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$' contains=vimComment,vim9Comment " Abbreviations: {{{2 @@ -369,8 +371,9 @@ syn keyword vimAbb ab[breviate] ca[bbrev] inorea[bbrev] cnorea[bbrev] norea[bbre " ======= syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent,nvimAutoEvent nextgroup=vimAutoCmdSpace syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList -syn match vimAutoCmdSfxList contained "\S*" +syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList +syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" " Echo and Execute: -- prefer strings! {{{2 " ================ @@ -609,7 +612,7 @@ syn match vimCtrlChar "[--]" " Beginners - Patterns that involve ^ {{{2 " ========= syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle -syn match vim9LineComment +^[ \t:]*#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle +syn match vim9LineComment +^[ \t]*#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup syn match vimContinue "^\s*\\" syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue @@ -840,6 +843,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimAutoCmdOpt vimOption hi def link vimAutoCmd vimCommand hi def link vimAutoEvent Type + hi def link vimAutoCmdMod Special hi def link vimAutoSet vimCommand hi def link vimBehaveModel vimBehave hi def link vimBehave vimCommand |