From da61cca9f79546dd9c947b1d4cbeefa1d3a32dc5 Mon Sep 17 00:00:00 2001 From: Saad Parwaiz Date: Wed, 27 Jan 2021 19:01:28 +0000 Subject: runtime/zsh: 23515b4ef7580af8b9d3b964a558ab2007cacda5 port zsh syntax file only --- runtime/syntax/zsh.vim | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/runtime/syntax/zsh.vim b/runtime/syntax/zsh.vim index ddb19b5800..819c419228 100644 --- a/runtime/syntax/zsh.vim +++ b/runtime/syntax/zsh.vim @@ -2,7 +2,7 @@ " Language: Zsh shell script " Maintainer: Christian Brabandt " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2020-01-23 +" Latest Revision: 2020-11-21 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-zsh @@ -14,7 +14,7 @@ let s:cpo_save = &cpo set cpo&vim function! s:ContainedGroup() - " needs 7.4.2008 for execute() function + " needs 7.4.2008 for execute() function let result='TOP' " vim-pandoc syntax defines the @langname cluster for embedded syntax languages " However, if no syntax is defined yet, `syn list @zsh` will return @@ -41,16 +41,6 @@ if get(g:, 'zsh_fold_enable', 0) setlocal foldmethod=syntax endif -syn keyword zshTodo contained TODO FIXME XXX NOTE - -syn region zshComment oneline start='\%(^\|\s\+\)#' end='$' - \ contains=zshTodo,@Spell fold - -syn region zshComment start='^\s*#' end='^\%(\s*#\)\@!' - \ contains=zshTodo,@Spell fold - -syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$' - syn match zshPOSIXQuoted '\\[xX][0-9a-fA-F]\{1,2}' syn match zshPOSIXQuoted '\\[0-7]\{1,3}' syn match zshPOSIXQuoted '\\u[0-9a-fA-F]\{1,4}' @@ -188,11 +178,13 @@ syn match zshOption / \ \%(\%(\\)\|\%(\%(no_\?\)\?case_match\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?c_bases\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?cdable_vars\>\)\|\%(\%(no_\?\)\?cd_able_vars\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?cd_silent\>\)\|\%(\%(no_\?\)\?cd_silent\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?chase_dots\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?chase_links\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?check_jobs\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?check_running_jobs\>\)\| \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?clobber_empty\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?combining_chars\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?complete_aliases\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?complete_in_word\>\)\| @@ -333,6 +325,7 @@ syn match zshOption / \ \%(\%(\\)\|\%(\%(no_\?\)\?sh_nullcmd\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?sh_option_letters\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?short_loops\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?short_repeat\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?sh_word_split\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?single_command\>\)\| \ \%(\%(\\)\|\%(\%(no_\?\)\?single_line_zle\>\)\| @@ -351,6 +344,8 @@ syn match zshOption / \ \%(\%(\\)\| \ \%(\%(\\)/ nextgroup=zshOption,zshComment skipwhite contained +syn case match + syn keyword zshTypes float integer local typeset declare private readonly " XXX: this may be too much @@ -368,7 +363,7 @@ exe 'syn region zshSubst matchgroup=zshSubstDelim transparent start=/\$(/ syn region zshParentheses transparent start='(' skip='\\)' end=')' fold syn region zshGlob start='(#' end=')' syn region zshMathSubst matchgroup=zshSubstDelim transparent - \ start='\$((' skip='\\)' end='))' + \ start='\%(\$\?\)[<=>]\@' +syn keyword zshTodo contained TODO FIXME XXX NOTE + +syn region zshComment oneline start='\%(^\|\s\+\)#' end='$' + \ contains=zshTodo,@Spell fold + +syn region zshComment start='^\s*#' end='^\%(\s*#\)\@!' + \ contains=zshTodo,@Spell fold + +syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$' + hi def link zshTodo Todo hi def link zshComment Comment hi def link zshPreProc PreProc -- cgit