comparison runtime/syntax/zsh.vim @ 23047:29c5f168c6fd

Update runtime files Commit: https://github.com/vim/vim/commit/23515b4ef7580af8b9d3b964a558ab2007cacda5 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Nov 29 14:36:24 2020 +0100 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Sun, 29 Nov 2020 14:45:04 +0100
parents 847a300aa244
children f0d7cb510ce3
comparison
equal deleted inserted replaced
23046:9a30b28b8154 23047:29c5f168c6fd
1 " Vim syntax file 1 " Vim syntax file
2 " Language: Zsh shell script 2 " Language: Zsh shell script
3 " Maintainer: Christian Brabandt <cb@256bit.org> 3 " Maintainer: Christian Brabandt <cb@256bit.org>
4 " Previous Maintainer: Nikolai Weibull <now@bitwi.se> 4 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
5 " Latest Revision: 2020-01-23 5 " Latest Revision: 2020-11-21
6 " License: Vim (see :h license) 6 " License: Vim (see :h license)
7 " Repository: https://github.com/chrisbra/vim-zsh 7 " Repository: https://github.com/chrisbra/vim-zsh
8 8
9 if exists("b:current_syntax") 9 if exists("b:current_syntax")
10 finish 10 finish
12 12
13 let s:cpo_save = &cpo 13 let s:cpo_save = &cpo
14 set cpo&vim 14 set cpo&vim
15 15
16 function! s:ContainedGroup() 16 function! s:ContainedGroup()
17 " needs 7.4.2008 for execute() function 17 " needs 7.4.2008 for execute() function
18 let result='TOP' 18 let result='TOP'
19 " vim-pandoc syntax defines the @langname cluster for embedded syntax languages 19 " vim-pandoc syntax defines the @langname cluster for embedded syntax languages
20 " However, if no syntax is defined yet, `syn list @zsh` will return 20 " However, if no syntax is defined yet, `syn list @zsh` will return
21 " "No syntax items defined", so make sure the result is actually a valid syn cluster 21 " "No syntax items defined", so make sure the result is actually a valid syn cluster
22 for cluster in ['markdownHighlightzsh', 'zsh'] 22 for cluster in ['markdownHighlightzsh', 'zsh']
38 38
39 syn iskeyword @,48-57,_,192-255,#,- 39 syn iskeyword @,48-57,_,192-255,#,-
40 if get(g:, 'zsh_fold_enable', 0) 40 if get(g:, 'zsh_fold_enable', 0)
41 setlocal foldmethod=syntax 41 setlocal foldmethod=syntax
42 endif 42 endif
43
44 syn keyword zshTodo contained TODO FIXME XXX NOTE
45
46 syn region zshComment oneline start='\%(^\|\s\+\)#' end='$'
47 \ contains=zshTodo,@Spell fold
48
49 syn region zshComment start='^\s*#' end='^\%(\s*#\)\@!'
50 \ contains=zshTodo,@Spell fold
51
52 syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$'
53 43
54 syn match zshPOSIXQuoted '\\[xX][0-9a-fA-F]\{1,2}' 44 syn match zshPOSIXQuoted '\\[xX][0-9a-fA-F]\{1,2}'
55 syn match zshPOSIXQuoted '\\[0-7]\{1,3}' 45 syn match zshPOSIXQuoted '\\[0-7]\{1,3}'
56 syn match zshPOSIXQuoted '\\u[0-9a-fA-F]\{1,4}' 46 syn match zshPOSIXQuoted '\\u[0-9a-fA-F]\{1,4}'
57 syn match zshPOSIXQuoted '\\U[1-9a-fA-F]\{1,8}' 47 syn match zshPOSIXQuoted '\\U[1-9a-fA-F]\{1,8}'
186 \ \%(\%(\<no_\?\)\?bsdecho\>\)\|\%(\%(no_\?\)\?bsd_echo\>\)\| 176 \ \%(\%(\<no_\?\)\?bsdecho\>\)\|\%(\%(no_\?\)\?bsd_echo\>\)\|
187 \ \%(\%(\<no_\?\)\?caseglob\>\)\|\%(\%(no_\?\)\?case_glob\>\)\| 177 \ \%(\%(\<no_\?\)\?caseglob\>\)\|\%(\%(no_\?\)\?case_glob\>\)\|
188 \ \%(\%(\<no_\?\)\?casematch\>\)\|\%(\%(no_\?\)\?case_match\>\)\| 178 \ \%(\%(\<no_\?\)\?casematch\>\)\|\%(\%(no_\?\)\?case_match\>\)\|
189 \ \%(\%(\<no_\?\)\?cbases\>\)\|\%(\%(no_\?\)\?c_bases\>\)\| 179 \ \%(\%(\<no_\?\)\?cbases\>\)\|\%(\%(no_\?\)\?c_bases\>\)\|
190 \ \%(\%(\<no_\?\)\?cdablevars\>\)\|\%(\%(no_\?\)\?cdable_vars\>\)\|\%(\%(no_\?\)\?cd_able_vars\>\)\| 180 \ \%(\%(\<no_\?\)\?cdablevars\>\)\|\%(\%(no_\?\)\?cdable_vars\>\)\|\%(\%(no_\?\)\?cd_able_vars\>\)\|
181 \ \%(\%(\<no_\?\)\?cdsilent\>\)\|\%(\%(no_\?\)\?cd_silent\>\)\|\%(\%(no_\?\)\?cd_silent\>\)\|
191 \ \%(\%(\<no_\?\)\?chasedots\>\)\|\%(\%(no_\?\)\?chase_dots\>\)\| 182 \ \%(\%(\<no_\?\)\?chasedots\>\)\|\%(\%(no_\?\)\?chase_dots\>\)\|
192 \ \%(\%(\<no_\?\)\?chaselinks\>\)\|\%(\%(no_\?\)\?chase_links\>\)\| 183 \ \%(\%(\<no_\?\)\?chaselinks\>\)\|\%(\%(no_\?\)\?chase_links\>\)\|
193 \ \%(\%(\<no_\?\)\?checkjobs\>\)\|\%(\%(no_\?\)\?check_jobs\>\)\| 184 \ \%(\%(\<no_\?\)\?checkjobs\>\)\|\%(\%(no_\?\)\?check_jobs\>\)\|
194 \ \%(\%(\<no_\?\)\?checkrunningjobs\>\)\|\%(\%(no_\?\)\?check_running_jobs\>\)\| 185 \ \%(\%(\<no_\?\)\?checkrunningjobs\>\)\|\%(\%(no_\?\)\?check_running_jobs\>\)\|
195 \ \%(\%(\<no_\?\)\?clobber\>\)\| 186 \ \%(\%(\<no_\?\)\?clobber\>\)\|
187 \ \%(\%(\<no_\?\)\?clobberempty\>\)\|\%(\%(no_\?\)\?clobber_empty\>\)\|
196 \ \%(\%(\<no_\?\)\?combiningchars\>\)\|\%(\%(no_\?\)\?combining_chars\>\)\| 188 \ \%(\%(\<no_\?\)\?combiningchars\>\)\|\%(\%(no_\?\)\?combining_chars\>\)\|
197 \ \%(\%(\<no_\?\)\?completealiases\>\)\|\%(\%(no_\?\)\?complete_aliases\>\)\| 189 \ \%(\%(\<no_\?\)\?completealiases\>\)\|\%(\%(no_\?\)\?complete_aliases\>\)\|
198 \ \%(\%(\<no_\?\)\?completeinword\>\)\|\%(\%(no_\?\)\?complete_in_word\>\)\| 190 \ \%(\%(\<no_\?\)\?completeinword\>\)\|\%(\%(no_\?\)\?complete_in_word\>\)\|
199 \ \%(\%(\<no_\?\)\?continueonerror\>\)\|\%(\%(no_\?\)\?continue_on_error\>\)\| 191 \ \%(\%(\<no_\?\)\?continueonerror\>\)\|\%(\%(no_\?\)\?continue_on_error\>\)\|
200 \ \%(\%(\<no_\?\)\?correct\>\)\| 192 \ \%(\%(\<no_\?\)\?correct\>\)\|
331 \ \%(\%(\<no_\?\)\?shglob\>\)\|\%(\%(no_\?\)\?sh_glob\>\)\| 323 \ \%(\%(\<no_\?\)\?shglob\>\)\|\%(\%(no_\?\)\?sh_glob\>\)\|
332 \ \%(\%(\<no_\?\)\?shinstdin\>\)\|\%(\%(no_\?\)\?shin_stdin\>\)\| 324 \ \%(\%(\<no_\?\)\?shinstdin\>\)\|\%(\%(no_\?\)\?shin_stdin\>\)\|
333 \ \%(\%(\<no_\?\)\?shnullcmd\>\)\|\%(\%(no_\?\)\?sh_nullcmd\>\)\| 325 \ \%(\%(\<no_\?\)\?shnullcmd\>\)\|\%(\%(no_\?\)\?sh_nullcmd\>\)\|
334 \ \%(\%(\<no_\?\)\?shoptionletters\>\)\|\%(\%(no_\?\)\?sh_option_letters\>\)\| 326 \ \%(\%(\<no_\?\)\?shoptionletters\>\)\|\%(\%(no_\?\)\?sh_option_letters\>\)\|
335 \ \%(\%(\<no_\?\)\?shortloops\>\)\|\%(\%(no_\?\)\?short_loops\>\)\| 327 \ \%(\%(\<no_\?\)\?shortloops\>\)\|\%(\%(no_\?\)\?short_loops\>\)\|
328 \ \%(\%(\<no_\?\)\?shortrepeat\>\)\|\%(\%(no_\?\)\?short_repeat\>\)\|
336 \ \%(\%(\<no_\?\)\?shwordsplit\>\)\|\%(\%(no_\?\)\?sh_word_split\>\)\| 329 \ \%(\%(\<no_\?\)\?shwordsplit\>\)\|\%(\%(no_\?\)\?sh_word_split\>\)\|
337 \ \%(\%(\<no_\?\)\?singlecommand\>\)\|\%(\%(no_\?\)\?single_command\>\)\| 330 \ \%(\%(\<no_\?\)\?singlecommand\>\)\|\%(\%(no_\?\)\?single_command\>\)\|
338 \ \%(\%(\<no_\?\)\?singlelinezle\>\)\|\%(\%(no_\?\)\?single_line_zle\>\)\| 331 \ \%(\%(\<no_\?\)\?singlelinezle\>\)\|\%(\%(no_\?\)\?single_line_zle\>\)\|
339 \ \%(\%(\<no_\?\)\?sourcetrace\>\)\|\%(\%(no_\?\)\?source_trace\>\)\| 332 \ \%(\%(\<no_\?\)\?sourcetrace\>\)\|\%(\%(no_\?\)\?source_trace\>\)\|
340 \ \%(\%(\<no_\?\)\?stdin\>\)\| 333 \ \%(\%(\<no_\?\)\?stdin\>\)\|
349 \ \%(\%(\<no_\?\)\?warnnestedvar\>\)\|\%(\%(no_\?\)\?warn_nested_var\>\)\| 342 \ \%(\%(\<no_\?\)\?warnnestedvar\>\)\|\%(\%(no_\?\)\?warn_nested_var\>\)\|
350 \ \%(\%(\<no_\?\)\?warncreateglobal\>\)\|\%(\%(no_\?\)\?warn_create_global\>\)\| 343 \ \%(\%(\<no_\?\)\?warncreateglobal\>\)\|\%(\%(no_\?\)\?warn_create_global\>\)\|
351 \ \%(\%(\<no_\?\)\?xtrace\>\)\| 344 \ \%(\%(\<no_\?\)\?xtrace\>\)\|
352 \ \%(\%(\<no_\?\)\?zle\>\)/ nextgroup=zshOption,zshComment skipwhite contained 345 \ \%(\%(\<no_\?\)\?zle\>\)/ nextgroup=zshOption,zshComment skipwhite contained
353 346
347 syn case match
348
354 syn keyword zshTypes float integer local typeset declare private readonly 349 syn keyword zshTypes float integer local typeset declare private readonly
355 350
356 " XXX: this may be too much 351 " XXX: this may be too much
357 " syn match zshSwitches '\s\zs--\=[a-zA-Z0-9-]\+' 352 " syn match zshSwitches '\s\zs--\=[a-zA-Z0-9-]\+'
358 353
366 syn cluster zshSubst contains=zshSubst,zshOldSubst,zshMathSubst 361 syn cluster zshSubst contains=zshSubst,zshOldSubst,zshMathSubst
367 exe 'syn region zshSubst matchgroup=zshSubstDelim transparent start=/\$(/ skip=/\\)/ end=/)/ contains='.s:contained. ' fold' 362 exe 'syn region zshSubst matchgroup=zshSubstDelim transparent start=/\$(/ skip=/\\)/ end=/)/ contains='.s:contained. ' fold'
368 syn region zshParentheses transparent start='(' skip='\\)' end=')' fold 363 syn region zshParentheses transparent start='(' skip='\\)' end=')' fold
369 syn region zshGlob start='(#' end=')' 364 syn region zshGlob start='(#' end=')'
370 syn region zshMathSubst matchgroup=zshSubstDelim transparent 365 syn region zshMathSubst matchgroup=zshSubstDelim transparent
371 \ start='\$((' skip='\\)' end='))' 366 \ start='\%(\$\?\)[<=>]\@<!((' skip='\\)' end='))'
372 \ contains=zshParentheses,@zshSubst,zshNumber, 367 \ contains=zshParentheses,@zshSubst,zshNumber,
373 \ @zshDerefs,zshString keepend fold 368 \ @zshDerefs,zshString keepend fold
374 " The ms=s+1 prevents matching zshBrackets several times on opening brackets 369 " The ms=s+1 prevents matching zshBrackets several times on opening brackets
375 " (see https://github.com/chrisbra/vim-zsh/issues/21#issuecomment-576330348) 370 " (see https://github.com/chrisbra/vim-zsh/issues/21#issuecomment-576330348)
376 syn region zshBrackets contained transparent start='{'ms=s+1 skip='\\}' 371 syn region zshBrackets contained transparent start='{'ms=s+1 skip='\\}'
382 exe 'syn region zshOldSubst matchgroup=zshSubstDelim start=/`/ skip=/\\[\\`]/ end=/`/ contains='.s:contained. ',zshOldSubst fold' 377 exe 'syn region zshOldSubst matchgroup=zshSubstDelim start=/`/ skip=/\\[\\`]/ end=/`/ contains='.s:contained. ',zshOldSubst fold'
383 378
384 syn sync minlines=50 maxlines=90 379 syn sync minlines=50 maxlines=90
385 syn sync match zshHereDocSync grouphere NONE '<<-\=\s*\%(\\\=\S\+\|\(["']\)\S\+\1\)' 380 syn sync match zshHereDocSync grouphere NONE '<<-\=\s*\%(\\\=\S\+\|\(["']\)\S\+\1\)'
386 syn sync match zshHereDocEndSync groupthere NONE '^\s*EO\a\+\>' 381 syn sync match zshHereDocEndSync groupthere NONE '^\s*EO\a\+\>'
382
383 syn keyword zshTodo contained TODO FIXME XXX NOTE
384
385 syn region zshComment oneline start='\%(^\|\s\+\)#' end='$'
386 \ contains=zshTodo,@Spell fold
387
388 syn region zshComment start='^\s*#' end='^\%(\s*#\)\@!'
389 \ contains=zshTodo,@Spell fold
390
391 syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$'
387 392
388 hi def link zshTodo Todo 393 hi def link zshTodo Todo
389 hi def link zshComment Comment 394 hi def link zshComment Comment
390 hi def link zshPreProc PreProc 395 hi def link zshPreProc PreProc
391 hi def link zshQuoted SpecialChar 396 hi def link zshQuoted SpecialChar