Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 2 | " Language: Zsh shell script |
| 3 | " Maintainer: Christian Brabandt <cb@256bit.org> |
| 4 | " Previous Maintainer: Nikolai Weibull <now@bitwi.se> |
Bram Moolenaar | 23515b4 | 2020-11-29 14:36:24 +0100 | [diff] [blame] | 5 | " Latest Revision: 2020-11-21 |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 6 | " License: Vim (see :h license) |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 7 | " Repository: https://github.com/chrisbra/vim-zsh |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8 | |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 9 | if exists("b:current_syntax") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10 | finish |
| 11 | endif |
| 12 | |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 13 | let s:cpo_save = &cpo |
| 14 | set cpo&vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 15 | |
Bram Moolenaar | b17893a | 2020-03-14 08:19:51 +0100 | [diff] [blame] | 16 | function! s:ContainedGroup() |
Bram Moolenaar | 23515b4 | 2020-11-29 14:36:24 +0100 | [diff] [blame] | 17 | " needs 7.4.2008 for execute() function |
Bram Moolenaar | b17893a | 2020-03-14 08:19:51 +0100 | [diff] [blame] | 18 | let result='TOP' |
| 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 |
| 21 | " "No syntax items defined", so make sure the result is actually a valid syn cluster |
| 22 | for cluster in ['markdownHighlightzsh', 'zsh'] |
| 23 | try |
| 24 | " markdown syntax defines embedded clusters as @markdownhighlight<lang>, |
| 25 | " pandoc just uses @<lang>, so check both for both clusters |
| 26 | let a=split(execute('syn list @'. cluster), "\n") |
| 27 | if len(a) == 2 && a[0] =~# '^---' && a[1] =~? cluster |
| 28 | return '@'. cluster |
| 29 | endif |
| 30 | catch /E392/ |
| 31 | " ignore |
| 32 | endtry |
| 33 | endfor |
| 34 | return result |
| 35 | endfunction |
| 36 | |
| 37 | let s:contained=s:ContainedGroup() |
| 38 | |
| 39 | syn iskeyword @,48-57,_,192-255,#,- |
Bram Moolenaar | f391327 | 2016-02-25 00:00:01 +0100 | [diff] [blame] | 40 | if get(g:, 'zsh_fold_enable', 0) |
| 41 | setlocal foldmethod=syntax |
| 42 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 43 | |
Bram Moolenaar | b17893a | 2020-03-14 08:19:51 +0100 | [diff] [blame] | 44 | syn match zshPOSIXQuoted '\\[xX][0-9a-fA-F]\{1,2}' |
| 45 | syn match zshPOSIXQuoted '\\[0-7]\{1,3}' |
| 46 | syn match zshPOSIXQuoted '\\u[0-9a-fA-F]\{1,4}' |
| 47 | syn match zshPOSIXQuoted '\\U[1-9a-fA-F]\{1,8}' |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 48 | syn match zshQuoted '\\.' |
| 49 | syn region zshString matchgroup=zshStringDelimiter start=+"+ end=+"+ |
Bram Moolenaar | f391327 | 2016-02-25 00:00:01 +0100 | [diff] [blame] | 50 | \ contains=zshQuoted,@zshDerefs,@zshSubst fold |
| 51 | syn region zshString matchgroup=zshStringDelimiter start=+'+ end=+'+ fold |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 52 | syn region zshPOSIXString matchgroup=zshStringDelimiter start=+\$'+ |
Bram Moolenaar | b17893a | 2020-03-14 08:19:51 +0100 | [diff] [blame] | 53 | \ skip=+\\[\\']+ end=+'+ contains=zshPOSIXQuoted,zshQuoted |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 54 | syn match zshJobSpec '%\(\d\+\|?\=\w\+\|[%+-]\)' |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 55 | |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 56 | syn keyword zshPrecommand noglob nocorrect exec command builtin - time |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 57 | |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 58 | syn keyword zshDelimiter do done end |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 59 | |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 60 | syn keyword zshConditional if then elif else fi case in esac select |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 61 | |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 62 | syn keyword zshRepeat while until repeat |
| 63 | |
| 64 | syn keyword zshRepeat for foreach nextgroup=zshVariable skipwhite |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 65 | |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 66 | syn keyword zshException always |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 67 | |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 68 | syn keyword zshKeyword function nextgroup=zshKSHFunction skipwhite |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 69 | |
Bram Moolenaar | f391327 | 2016-02-25 00:00:01 +0100 | [diff] [blame] | 70 | syn match zshKSHFunction contained '\w\S\+' |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 71 | syn match zshFunction '^\s*\k\+\ze\s*()' |
| 72 | |
| 73 | syn match zshOperator '||\|&&\|;\|&!\=' |
| 74 | |
| 75 | syn match zshRedir '\d\=\(<\|<>\|<<<\|<&\s*[0-9p-]\=\)' |
| 76 | syn match zshRedir '\d\=\(>\|>>\|>&\s*[0-9p-]\=\|&>\|>>&\|&>>\)[|!]\=' |
| 77 | syn match zshRedir '|&\=' |
| 78 | |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 79 | syn region zshHereDoc matchgroup=zshRedir |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 80 | \ start='<\@<!<<\s*\z([^<]\S*\)' |
| 81 | \ end='^\z1\>' |
Bram Moolenaar | 7db25fe | 2018-05-13 00:02:36 +0200 | [diff] [blame] | 82 | \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 83 | syn region zshHereDoc matchgroup=zshRedir |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 84 | \ start='<\@<!<<\s*\\\z(\S\+\)' |
| 85 | \ end='^\z1\>' |
Bram Moolenaar | 7db25fe | 2018-05-13 00:02:36 +0200 | [diff] [blame] | 86 | \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 87 | syn region zshHereDoc matchgroup=zshRedir |
| 88 | \ start='<\@<!<<-\s*\\\=\z(\S\+\)' |
| 89 | \ end='^\s*\z1\>' |
Bram Moolenaar | 7db25fe | 2018-05-13 00:02:36 +0200 | [diff] [blame] | 90 | \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 91 | syn region zshHereDoc matchgroup=zshRedir |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 92 | \ start=+<\@<!<<\s*\(["']\)\z(\S\+\)\1+ |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 93 | \ end='^\z1\>' |
| 94 | syn region zshHereDoc matchgroup=zshRedir |
| 95 | \ start=+<\@<!<<-\s*\(["']\)\z(\S\+\)\1+ |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 96 | \ end='^\s*\z1\>' |
| 97 | |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 98 | syn match zshVariable '\<\h\w*' contained |
| 99 | |
| 100 | syn match zshVariableDef '\<\h\w*\ze+\==' |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 101 | " XXX: how safe is this? |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 102 | syn region zshVariableDef oneline |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 103 | \ start='\$\@<!\<\h\w*\[' end='\]\ze+\?=\?' |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 104 | \ contains=@zshSubst |
| 105 | |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 106 | syn cluster zshDerefs contains=zshShortDeref,zshLongDeref,zshDeref,zshDollarVar |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 107 | |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 108 | syn match zshShortDeref '\$[!#$*@?_-]\w\@!' |
| 109 | syn match zshShortDeref '\$[=^~]*[#+]*\d\+\>' |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 110 | |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 111 | syn match zshLongDeref '\$\%(ARGC\|argv\|status\|pipestatus\|CPUTYPE\|EGID\|EUID\|ERRNO\|GID\|HOST\|LINENO\|LOGNAME\)' |
| 112 | syn match zshLongDeref '\$\%(MACHTYPE\|OLDPWD OPTARG\|OPTIND\|OSTYPE\|PPID\|PWD\|RANDOM\|SECONDS\|SHLVL\|signals\)' |
| 113 | syn match zshLongDeref '\$\%(TRY_BLOCK_ERROR\|TTY\|TTYIDLE\|UID\|USERNAME\|VENDOR\|ZSH_NAME\|ZSH_VERSION\|REPLY\|reply\|TERM\)' |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 114 | |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 115 | syn match zshDollarVar '\$\h\w*' |
| 116 | syn match zshDeref '\$[=^~]*[#+]*\h\w*\>' |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 117 | |
| 118 | syn match zshCommands '\%(^\|\s\)[.:]\ze\s' |
| 119 | syn keyword zshCommands alias autoload bg bindkey break bye cap cd |
| 120 | \ chdir clone comparguments compcall compctl |
| 121 | \ compdescribe compfiles compgroups compquote |
| 122 | \ comptags comptry compvalues continue dirs |
| 123 | \ disable disown echo echotc echoti emulate |
| 124 | \ enable eval exec exit export false fc fg |
| 125 | \ functions getcap getln getopts hash history |
| 126 | \ jobs kill let limit log logout popd print |
Bram Moolenaar | 96f45c0 | 2019-10-26 19:53:45 +0200 | [diff] [blame] | 127 | \ printf pushd pushln pwd r read |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 128 | \ rehash return sched set setcap shift |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 129 | \ source stat suspend test times trap true |
| 130 | \ ttyctl type ulimit umask unalias unfunction |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 131 | \ unhash unlimit unset vared wait |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 132 | \ whence where which zcompile zformat zftp zle |
Bram Moolenaar | 7db25fe | 2018-05-13 00:02:36 +0200 | [diff] [blame] | 133 | \ zmodload zparseopts zprof zpty zrecompile |
| 134 | \ zregexparse zsocket zstyle ztcp |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 135 | |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 136 | " Options, generated by: echo ${(j:\n:)options[(I)*]} | sort |
Bram Moolenaar | fa73534 | 2016-01-03 22:14:44 +0100 | [diff] [blame] | 137 | " Create a list of option names from zsh source dir: |
| 138 | " #!/bin/zsh |
| 139 | " topdir=/path/to/zsh-xxx |
Bram Moolenaar | 96f45c0 | 2019-10-26 19:53:45 +0200 | [diff] [blame] | 140 | " grep '^pindex([A-Za-z_]*)$' $topdir/Doc/Zsh/options.yo | |
Bram Moolenaar | fa73534 | 2016-01-03 22:14:44 +0100 | [diff] [blame] | 141 | " while read opt |
| 142 | " do |
| 143 | " echo ${${(L)opt#pindex\(}%\)} |
| 144 | " done |
| 145 | |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 146 | syn case ignore |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 147 | |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 148 | syn match zshOptStart /^\s*\%(\%(\%(un\)\?setopt\)\|set\s+[-+]o\)/ nextgroup=zshOption skipwhite |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 149 | syn match zshOption / |
| 150 | \ \%(\%(\<no_\?\)\?aliases\>\)\| |
Bram Moolenaar | 96f45c0 | 2019-10-26 19:53:45 +0200 | [diff] [blame] | 151 | \ \%(\%(\<no_\?\)\?aliasfuncdef\>\)\|\%(\%(no_\?\)\?alias_func_def\>\)\| |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 152 | \ \%(\%(\<no_\?\)\?allexport\>\)\|\%(\%(no_\?\)\?all_export\>\)\| |
| 153 | \ \%(\%(\<no_\?\)\?alwayslastprompt\>\)\|\%(\%(no_\?\)\?always_last_prompt\>\)\|\%(\%(no_\?\)\?always_lastprompt\>\)\| |
| 154 | \ \%(\%(\<no_\?\)\?alwaystoend\>\)\|\%(\%(no_\?\)\?always_to_end\>\)\| |
| 155 | \ \%(\%(\<no_\?\)\?appendcreate\>\)\|\%(\%(no_\?\)\?append_create\>\)\| |
| 156 | \ \%(\%(\<no_\?\)\?appendhistory\>\)\|\%(\%(no_\?\)\?append_history\>\)\| |
| 157 | \ \%(\%(\<no_\?\)\?autocd\>\)\|\%(\%(no_\?\)\?auto_cd\>\)\| |
| 158 | \ \%(\%(\<no_\?\)\?autocontinue\>\)\|\%(\%(no_\?\)\?auto_continue\>\)\| |
| 159 | \ \%(\%(\<no_\?\)\?autolist\>\)\|\%(\%(no_\?\)\?auto_list\>\)\| |
| 160 | \ \%(\%(\<no_\?\)\?automenu\>\)\|\%(\%(no_\?\)\?auto_menu\>\)\| |
| 161 | \ \%(\%(\<no_\?\)\?autonamedirs\>\)\|\%(\%(no_\?\)\?auto_name_dirs\>\)\| |
| 162 | \ \%(\%(\<no_\?\)\?autoparamkeys\>\)\|\%(\%(no_\?\)\?auto_param_keys\>\)\| |
| 163 | \ \%(\%(\<no_\?\)\?autoparamslash\>\)\|\%(\%(no_\?\)\?auto_param_slash\>\)\| |
| 164 | \ \%(\%(\<no_\?\)\?autopushd\>\)\|\%(\%(no_\?\)\?auto_pushd\>\)\| |
| 165 | \ \%(\%(\<no_\?\)\?autoremoveslash\>\)\|\%(\%(no_\?\)\?auto_remove_slash\>\)\| |
| 166 | \ \%(\%(\<no_\?\)\?autoresume\>\)\|\%(\%(no_\?\)\?auto_resume\>\)\| |
| 167 | \ \%(\%(\<no_\?\)\?badpattern\>\)\|\%(\%(no_\?\)\?bad_pattern\>\)\| |
| 168 | \ \%(\%(\<no_\?\)\?banghist\>\)\|\%(\%(no_\?\)\?bang_hist\>\)\| |
| 169 | \ \%(\%(\<no_\?\)\?bareglobqual\>\)\|\%(\%(no_\?\)\?bare_glob_qual\>\)\| |
| 170 | \ \%(\%(\<no_\?\)\?bashautolist\>\)\|\%(\%(no_\?\)\?bash_auto_list\>\)\| |
| 171 | \ \%(\%(\<no_\?\)\?bashrematch\>\)\|\%(\%(no_\?\)\?bash_rematch\>\)\| |
| 172 | \ \%(\%(\<no_\?\)\?beep\>\)\| |
| 173 | \ \%(\%(\<no_\?\)\?bgnice\>\)\|\%(\%(no_\?\)\?bg_nice\>\)\| |
| 174 | \ \%(\%(\<no_\?\)\?braceccl\>\)\|\%(\%(no_\?\)\?brace_ccl\>\)\| |
| 175 | \ \%(\%(\<no_\?\)\?braceexpand\>\)\|\%(\%(no_\?\)\?brace_expand\>\)\| |
| 176 | \ \%(\%(\<no_\?\)\?bsdecho\>\)\|\%(\%(no_\?\)\?bsd_echo\>\)\| |
| 177 | \ \%(\%(\<no_\?\)\?caseglob\>\)\|\%(\%(no_\?\)\?case_glob\>\)\| |
| 178 | \ \%(\%(\<no_\?\)\?casematch\>\)\|\%(\%(no_\?\)\?case_match\>\)\| |
| 179 | \ \%(\%(\<no_\?\)\?cbases\>\)\|\%(\%(no_\?\)\?c_bases\>\)\| |
| 180 | \ \%(\%(\<no_\?\)\?cdablevars\>\)\|\%(\%(no_\?\)\?cdable_vars\>\)\|\%(\%(no_\?\)\?cd_able_vars\>\)\| |
Bram Moolenaar | 23515b4 | 2020-11-29 14:36:24 +0100 | [diff] [blame] | 181 | \ \%(\%(\<no_\?\)\?cdsilent\>\)\|\%(\%(no_\?\)\?cd_silent\>\)\|\%(\%(no_\?\)\?cd_silent\>\)\| |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 182 | \ \%(\%(\<no_\?\)\?chasedots\>\)\|\%(\%(no_\?\)\?chase_dots\>\)\| |
| 183 | \ \%(\%(\<no_\?\)\?chaselinks\>\)\|\%(\%(no_\?\)\?chase_links\>\)\| |
| 184 | \ \%(\%(\<no_\?\)\?checkjobs\>\)\|\%(\%(no_\?\)\?check_jobs\>\)\| |
Bram Moolenaar | 96f45c0 | 2019-10-26 19:53:45 +0200 | [diff] [blame] | 185 | \ \%(\%(\<no_\?\)\?checkrunningjobs\>\)\|\%(\%(no_\?\)\?check_running_jobs\>\)\| |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 186 | \ \%(\%(\<no_\?\)\?clobber\>\)\| |
Bram Moolenaar | 23515b4 | 2020-11-29 14:36:24 +0100 | [diff] [blame] | 187 | \ \%(\%(\<no_\?\)\?clobberempty\>\)\|\%(\%(no_\?\)\?clobber_empty\>\)\| |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 188 | \ \%(\%(\<no_\?\)\?combiningchars\>\)\|\%(\%(no_\?\)\?combining_chars\>\)\| |
| 189 | \ \%(\%(\<no_\?\)\?completealiases\>\)\|\%(\%(no_\?\)\?complete_aliases\>\)\| |
| 190 | \ \%(\%(\<no_\?\)\?completeinword\>\)\|\%(\%(no_\?\)\?complete_in_word\>\)\| |
| 191 | \ \%(\%(\<no_\?\)\?continueonerror\>\)\|\%(\%(no_\?\)\?continue_on_error\>\)\| |
| 192 | \ \%(\%(\<no_\?\)\?correct\>\)\| |
| 193 | \ \%(\%(\<no_\?\)\?correctall\>\)\|\%(\%(no_\?\)\?correct_all\>\)\| |
| 194 | \ \%(\%(\<no_\?\)\?cprecedences\>\)\|\%(\%(no_\?\)\?c_precedences\>\)\| |
| 195 | \ \%(\%(\<no_\?\)\?cshjunkiehistory\>\)\|\%(\%(no_\?\)\?csh_junkie_history\>\)\| |
| 196 | \ \%(\%(\<no_\?\)\?cshjunkieloops\>\)\|\%(\%(no_\?\)\?csh_junkie_loops\>\)\| |
| 197 | \ \%(\%(\<no_\?\)\?cshjunkiequotes\>\)\|\%(\%(no_\?\)\?csh_junkie_quotes\>\)\| |
| 198 | \ \%(\%(\<no_\?\)\?csh_nullcmd\>\)\|\%(\%(no_\?\)\?csh_null_cmd\>\)\|\%(\%(no_\?\)\?cshnullcmd\>\)\|\%(\%(no_\?\)\?csh_null_cmd\>\)\| |
| 199 | \ \%(\%(\<no_\?\)\?cshnullglob\>\)\|\%(\%(no_\?\)\?csh_null_glob\>\)\| |
| 200 | \ \%(\%(\<no_\?\)\?debugbeforecmd\>\)\|\%(\%(no_\?\)\?debug_before_cmd\>\)\| |
| 201 | \ \%(\%(\<no_\?\)\?dotglob\>\)\|\%(\%(no_\?\)\?dot_glob\>\)\| |
| 202 | \ \%(\%(\<no_\?\)\?dvorak\>\)\| |
| 203 | \ \%(\%(\<no_\?\)\?emacs\>\)\| |
| 204 | \ \%(\%(\<no_\?\)\?equals\>\)\| |
| 205 | \ \%(\%(\<no_\?\)\?errexit\>\)\|\%(\%(no_\?\)\?err_exit\>\)\| |
| 206 | \ \%(\%(\<no_\?\)\?errreturn\>\)\|\%(\%(no_\?\)\?err_return\>\)\| |
Bram Moolenaar | 96f45c0 | 2019-10-26 19:53:45 +0200 | [diff] [blame] | 207 | \ \%(\%(\<no_\?\)\?evallineno\>\)\|\%(\%(no_\?\)\?eval_lineno\>\)\| |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 208 | \ \%(\%(\<no_\?\)\?exec\>\)\| |
| 209 | \ \%(\%(\<no_\?\)\?extendedglob\>\)\|\%(\%(no_\?\)\?extended_glob\>\)\| |
| 210 | \ \%(\%(\<no_\?\)\?extendedhistory\>\)\|\%(\%(no_\?\)\?extended_history\>\)\| |
| 211 | \ \%(\%(\<no_\?\)\?flowcontrol\>\)\|\%(\%(no_\?\)\?flow_control\>\)\| |
| 212 | \ \%(\%(\<no_\?\)\?forcefloat\>\)\|\%(\%(no_\?\)\?force_float\>\)\| |
| 213 | \ \%(\%(\<no_\?\)\?functionargzero\>\)\|\%(\%(no_\?\)\?function_argzero\>\)\|\%(\%(no_\?\)\?function_arg_zero\>\)\| |
| 214 | \ \%(\%(\<no_\?\)\?glob\>\)\| |
| 215 | \ \%(\%(\<no_\?\)\?globalexport\>\)\|\%(\%(no_\?\)\?global_export\>\)\| |
| 216 | \ \%(\%(\<no_\?\)\?globalrcs\>\)\|\%(\%(no_\?\)\?global_rcs\>\)\| |
| 217 | \ \%(\%(\<no_\?\)\?globassign\>\)\|\%(\%(no_\?\)\?glob_assign\>\)\| |
| 218 | \ \%(\%(\<no_\?\)\?globcomplete\>\)\|\%(\%(no_\?\)\?glob_complete\>\)\| |
| 219 | \ \%(\%(\<no_\?\)\?globdots\>\)\|\%(\%(no_\?\)\?glob_dots\>\)\| |
| 220 | \ \%(\%(\<no_\?\)\?glob_subst\>\)\|\%(\%(no_\?\)\?globsubst\>\)\| |
| 221 | \ \%(\%(\<no_\?\)\?globstarshort\>\)\|\%(\%(no_\?\)\?glob_star_short\>\)\| |
| 222 | \ \%(\%(\<no_\?\)\?hashall\>\)\|\%(\%(no_\?\)\?hash_all\>\)\| |
| 223 | \ \%(\%(\<no_\?\)\?hashcmds\>\)\|\%(\%(no_\?\)\?hash_cmds\>\)\| |
| 224 | \ \%(\%(\<no_\?\)\?hashdirs\>\)\|\%(\%(no_\?\)\?hash_dirs\>\)\| |
| 225 | \ \%(\%(\<no_\?\)\?hashexecutablesonly\>\)\|\%(\%(no_\?\)\?hash_executables_only\>\)\| |
| 226 | \ \%(\%(\<no_\?\)\?hashlistall\>\)\|\%(\%(no_\?\)\?hash_list_all\>\)\| |
| 227 | \ \%(\%(\<no_\?\)\?histallowclobber\>\)\|\%(\%(no_\?\)\?hist_allow_clobber\>\)\| |
| 228 | \ \%(\%(\<no_\?\)\?histappend\>\)\|\%(\%(no_\?\)\?hist_append\>\)\| |
| 229 | \ \%(\%(\<no_\?\)\?histbeep\>\)\|\%(\%(no_\?\)\?hist_beep\>\)\| |
| 230 | \ \%(\%(\<no_\?\)\?hist_expand\>\)\|\%(\%(no_\?\)\?histexpand\>\)\| |
| 231 | \ \%(\%(\<no_\?\)\?hist_expire_dups_first\>\)\|\%(\%(no_\?\)\?histexpiredupsfirst\>\)\| |
| 232 | \ \%(\%(\<no_\?\)\?histfcntllock\>\)\|\%(\%(no_\?\)\?hist_fcntl_lock\>\)\| |
| 233 | \ \%(\%(\<no_\?\)\?histfindnodups\>\)\|\%(\%(no_\?\)\?hist_find_no_dups\>\)\| |
| 234 | \ \%(\%(\<no_\?\)\?histignorealldups\>\)\|\%(\%(no_\?\)\?hist_ignore_all_dups\>\)\| |
| 235 | \ \%(\%(\<no_\?\)\?histignoredups\>\)\|\%(\%(no_\?\)\?hist_ignore_dups\>\)\| |
| 236 | \ \%(\%(\<no_\?\)\?histignorespace\>\)\|\%(\%(no_\?\)\?hist_ignore_space\>\)\| |
| 237 | \ \%(\%(\<no_\?\)\?histlexwords\>\)\|\%(\%(no_\?\)\?hist_lex_words\>\)\| |
| 238 | \ \%(\%(\<no_\?\)\?histnofunctions\>\)\|\%(\%(no_\?\)\?hist_no_functions\>\)\| |
| 239 | \ \%(\%(\<no_\?\)\?histnostore\>\)\|\%(\%(no_\?\)\?hist_no_store\>\)\| |
| 240 | \ \%(\%(\<no_\?\)\?histreduceblanks\>\)\|\%(\%(no_\?\)\?hist_reduce_blanks\>\)\| |
| 241 | \ \%(\%(\<no_\?\)\?histsavebycopy\>\)\|\%(\%(no_\?\)\?hist_save_by_copy\>\)\| |
| 242 | \ \%(\%(\<no_\?\)\?histsavenodups\>\)\|\%(\%(no_\?\)\?hist_save_no_dups\>\)\| |
| 243 | \ \%(\%(\<no_\?\)\?histsubstpattern\>\)\|\%(\%(no_\?\)\?hist_subst_pattern\>\)\| |
| 244 | \ \%(\%(\<no_\?\)\?histverify\>\)\|\%(\%(no_\?\)\?hist_verify\>\)\| |
| 245 | \ \%(\%(\<no_\?\)\?hup\>\)\| |
| 246 | \ \%(\%(\<no_\?\)\?ignorebraces\>\)\|\%(\%(no_\?\)\?ignore_braces\>\)\| |
| 247 | \ \%(\%(\<no_\?\)\?ignoreclosebraces\>\)\|\%(\%(no_\?\)\?ignore_close_braces\>\)\| |
| 248 | \ \%(\%(\<no_\?\)\?ignoreeof\>\)\|\%(\%(no_\?\)\?ignore_eof\>\)\| |
| 249 | \ \%(\%(\<no_\?\)\?incappendhistory\>\)\|\%(\%(no_\?\)\?inc_append_history\>\)\| |
| 250 | \ \%(\%(\<no_\?\)\?incappendhistorytime\>\)\|\%(\%(no_\?\)\?inc_append_history_time\>\)\| |
| 251 | \ \%(\%(\<no_\?\)\?interactive\>\)\| |
| 252 | \ \%(\%(\<no_\?\)\?interactivecomments\>\)\|\%(\%(no_\?\)\?interactive_comments\>\)\| |
| 253 | \ \%(\%(\<no_\?\)\?ksharrays\>\)\|\%(\%(no_\?\)\?ksh_arrays\>\)\| |
| 254 | \ \%(\%(\<no_\?\)\?kshautoload\>\)\|\%(\%(no_\?\)\?ksh_autoload\>\)\| |
| 255 | \ \%(\%(\<no_\?\)\?kshglob\>\)\|\%(\%(no_\?\)\?ksh_glob\>\)\| |
| 256 | \ \%(\%(\<no_\?\)\?kshoptionprint\>\)\|\%(\%(no_\?\)\?ksh_option_print\>\)\| |
| 257 | \ \%(\%(\<no_\?\)\?kshtypeset\>\)\|\%(\%(no_\?\)\?ksh_typeset\>\)\| |
| 258 | \ \%(\%(\<no_\?\)\?kshzerosubscript\>\)\|\%(\%(no_\?\)\?ksh_zero_subscript\>\)\| |
| 259 | \ \%(\%(\<no_\?\)\?listambiguous\>\)\|\%(\%(no_\?\)\?list_ambiguous\>\)\| |
| 260 | \ \%(\%(\<no_\?\)\?listbeep\>\)\|\%(\%(no_\?\)\?list_beep\>\)\| |
| 261 | \ \%(\%(\<no_\?\)\?listpacked\>\)\|\%(\%(no_\?\)\?list_packed\>\)\| |
| 262 | \ \%(\%(\<no_\?\)\?listrowsfirst\>\)\|\%(\%(no_\?\)\?list_rows_first\>\)\| |
| 263 | \ \%(\%(\<no_\?\)\?listtypes\>\)\|\%(\%(no_\?\)\?list_types\>\)\| |
| 264 | \ \%(\%(\<no_\?\)\?localloops\>\)\|\%(\%(no_\?\)\?local_loops\>\)\| |
| 265 | \ \%(\%(\<no_\?\)\?localoptions\>\)\|\%(\%(no_\?\)\?local_options\>\)\| |
| 266 | \ \%(\%(\<no_\?\)\?localpatterns\>\)\|\%(\%(no_\?\)\?local_patterns\>\)\| |
| 267 | \ \%(\%(\<no_\?\)\?localtraps\>\)\|\%(\%(no_\?\)\?local_traps\>\)\| |
| 268 | \ \%(\%(\<no_\?\)\?log\>\)\| |
| 269 | \ \%(\%(\<no_\?\)\?login\>\)\| |
| 270 | \ \%(\%(\<no_\?\)\?longlistjobs\>\)\|\%(\%(no_\?\)\?long_list_jobs\>\)\| |
| 271 | \ \%(\%(\<no_\?\)\?magicequalsubst\>\)\|\%(\%(no_\?\)\?magic_equal_subst\>\)\| |
| 272 | \ \%(\%(\<no_\?\)\?mark_dirs\>\)\| |
| 273 | \ \%(\%(\<no_\?\)\?mailwarn\>\)\|\%(\%(no_\?\)\?mail_warn\>\)\| |
| 274 | \ \%(\%(\<no_\?\)\?mailwarning\>\)\|\%(\%(no_\?\)\?mail_warning\>\)\| |
| 275 | \ \%(\%(\<no_\?\)\?markdirs\>\)\| |
| 276 | \ \%(\%(\<no_\?\)\?menucomplete\>\)\|\%(\%(no_\?\)\?menu_complete\>\)\| |
| 277 | \ \%(\%(\<no_\?\)\?monitor\>\)\| |
| 278 | \ \%(\%(\<no_\?\)\?multibyte\>\)\|\%(\%(no_\?\)\?multi_byte\>\)\| |
| 279 | \ \%(\%(\<no_\?\)\?multifuncdef\>\)\|\%(\%(no_\?\)\?multi_func_def\>\)\| |
| 280 | \ \%(\%(\<no_\?\)\?multios\>\)\|\%(\%(no_\?\)\?multi_os\>\)\| |
| 281 | \ \%(\%(\<no_\?\)\?nomatch\>\)\|\%(\%(no_\?\)\?no_match\>\)\| |
| 282 | \ \%(\%(\<no_\?\)\?notify\>\)\| |
| 283 | \ \%(\%(\<no_\?\)\?nullglob\>\)\|\%(\%(no_\?\)\?null_glob\>\)\| |
| 284 | \ \%(\%(\<no_\?\)\?numericglobsort\>\)\|\%(\%(no_\?\)\?numeric_glob_sort\>\)\| |
| 285 | \ \%(\%(\<no_\?\)\?octalzeroes\>\)\|\%(\%(no_\?\)\?octal_zeroes\>\)\| |
| 286 | \ \%(\%(\<no_\?\)\?onecmd\>\)\|\%(\%(no_\?\)\?one_cmd\>\)\| |
| 287 | \ \%(\%(\<no_\?\)\?overstrike\>\)\|\%(\%(no_\?\)\?over_strike\>\)\| |
| 288 | \ \%(\%(\<no_\?\)\?pathdirs\>\)\|\%(\%(no_\?\)\?path_dirs\>\)\| |
| 289 | \ \%(\%(\<no_\?\)\?pathscript\>\)\|\%(\%(no_\?\)\?path_script\>\)\| |
| 290 | \ \%(\%(\<no_\?\)\?physical\>\)\| |
| 291 | \ \%(\%(\<no_\?\)\?pipefail\>\)\|\%(\%(no_\?\)\?pipe_fail\>\)\| |
| 292 | \ \%(\%(\<no_\?\)\?posixaliases\>\)\|\%(\%(no_\?\)\?posix_aliases\>\)\| |
| 293 | \ \%(\%(\<no_\?\)\?posixargzero\>\)\|\%(\%(no_\?\)\?posix_arg_zero\>\)\|\%(\%(no_\?\)\?posix_argzero\>\)\| |
| 294 | \ \%(\%(\<no_\?\)\?posixbuiltins\>\)\|\%(\%(no_\?\)\?posix_builtins\>\)\| |
| 295 | \ \%(\%(\<no_\?\)\?posixcd\>\)\|\%(\%(no_\?\)\?posix_cd\>\)\| |
| 296 | \ \%(\%(\<no_\?\)\?posixidentifiers\>\)\|\%(\%(no_\?\)\?posix_identifiers\>\)\| |
| 297 | \ \%(\%(\<no_\?\)\?posixjobs\>\)\|\%(\%(no_\?\)\?posix_jobs\>\)\| |
| 298 | \ \%(\%(\<no_\?\)\?posixstrings\>\)\|\%(\%(no_\?\)\?posix_strings\>\)\| |
| 299 | \ \%(\%(\<no_\?\)\?posixtraps\>\)\|\%(\%(no_\?\)\?posix_traps\>\)\| |
| 300 | \ \%(\%(\<no_\?\)\?printeightbit\>\)\|\%(\%(no_\?\)\?print_eight_bit\>\)\| |
| 301 | \ \%(\%(\<no_\?\)\?printexitvalue\>\)\|\%(\%(no_\?\)\?print_exit_value\>\)\| |
| 302 | \ \%(\%(\<no_\?\)\?privileged\>\)\| |
| 303 | \ \%(\%(\<no_\?\)\?promptbang\>\)\|\%(\%(no_\?\)\?prompt_bang\>\)\| |
| 304 | \ \%(\%(\<no_\?\)\?promptcr\>\)\|\%(\%(no_\?\)\?prompt_cr\>\)\| |
| 305 | \ \%(\%(\<no_\?\)\?promptpercent\>\)\|\%(\%(no_\?\)\?prompt_percent\>\)\| |
| 306 | \ \%(\%(\<no_\?\)\?promptsp\>\)\|\%(\%(no_\?\)\?prompt_sp\>\)\| |
| 307 | \ \%(\%(\<no_\?\)\?promptsubst\>\)\|\%(\%(no_\?\)\?prompt_subst\>\)\| |
| 308 | \ \%(\%(\<no_\?\)\?promptvars\>\)\|\%(\%(no_\?\)\?prompt_vars\>\)\| |
| 309 | \ \%(\%(\<no_\?\)\?pushdignoredups\>\)\|\%(\%(no_\?\)\?pushd_ignore_dups\>\)\| |
| 310 | \ \%(\%(\<no_\?\)\?pushdminus\>\)\|\%(\%(no_\?\)\?pushd_minus\>\)\| |
| 311 | \ \%(\%(\<no_\?\)\?pushdsilent\>\)\|\%(\%(no_\?\)\?pushd_silent\>\)\| |
| 312 | \ \%(\%(\<no_\?\)\?pushdtohome\>\)\|\%(\%(no_\?\)\?pushd_to_home\>\)\| |
| 313 | \ \%(\%(\<no_\?\)\?rcexpandparam\>\)\|\%(\%(no_\?\)\?rc_expandparam\>\)\|\%(\%(no_\?\)\?rc_expand_param\>\)\| |
| 314 | \ \%(\%(\<no_\?\)\?rcquotes\>\)\|\%(\%(no_\?\)\?rc_quotes\>\)\| |
| 315 | \ \%(\%(\<no_\?\)\?rcs\>\)\| |
| 316 | \ \%(\%(\<no_\?\)\?recexact\>\)\|\%(\%(no_\?\)\?rec_exact\>\)\| |
| 317 | \ \%(\%(\<no_\?\)\?rematchpcre\>\)\|\%(\%(no_\?\)\?re_match_pcre\>\)\|\%(\%(no_\?\)\?rematch_pcre\>\)\| |
| 318 | \ \%(\%(\<no_\?\)\?restricted\>\)\| |
| 319 | \ \%(\%(\<no_\?\)\?rmstarsilent\>\)\|\%(\%(no_\?\)\?rm_star_silent\>\)\| |
| 320 | \ \%(\%(\<no_\?\)\?rmstarwait\>\)\|\%(\%(no_\?\)\?rm_star_wait\>\)\| |
| 321 | \ \%(\%(\<no_\?\)\?sharehistory\>\)\|\%(\%(no_\?\)\?share_history\>\)\| |
| 322 | \ \%(\%(\<no_\?\)\?shfileexpansion\>\)\|\%(\%(no_\?\)\?sh_file_expansion\>\)\| |
| 323 | \ \%(\%(\<no_\?\)\?shglob\>\)\|\%(\%(no_\?\)\?sh_glob\>\)\| |
| 324 | \ \%(\%(\<no_\?\)\?shinstdin\>\)\|\%(\%(no_\?\)\?shin_stdin\>\)\| |
| 325 | \ \%(\%(\<no_\?\)\?shnullcmd\>\)\|\%(\%(no_\?\)\?sh_nullcmd\>\)\| |
| 326 | \ \%(\%(\<no_\?\)\?shoptionletters\>\)\|\%(\%(no_\?\)\?sh_option_letters\>\)\| |
| 327 | \ \%(\%(\<no_\?\)\?shortloops\>\)\|\%(\%(no_\?\)\?short_loops\>\)\| |
Bram Moolenaar | 23515b4 | 2020-11-29 14:36:24 +0100 | [diff] [blame] | 328 | \ \%(\%(\<no_\?\)\?shortrepeat\>\)\|\%(\%(no_\?\)\?short_repeat\>\)\| |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 329 | \ \%(\%(\<no_\?\)\?shwordsplit\>\)\|\%(\%(no_\?\)\?sh_word_split\>\)\| |
| 330 | \ \%(\%(\<no_\?\)\?singlecommand\>\)\|\%(\%(no_\?\)\?single_command\>\)\| |
| 331 | \ \%(\%(\<no_\?\)\?singlelinezle\>\)\|\%(\%(no_\?\)\?single_line_zle\>\)\| |
| 332 | \ \%(\%(\<no_\?\)\?sourcetrace\>\)\|\%(\%(no_\?\)\?source_trace\>\)\| |
| 333 | \ \%(\%(\<no_\?\)\?stdin\>\)\| |
| 334 | \ \%(\%(\<no_\?\)\?sunkeyboardhack\>\)\|\%(\%(no_\?\)\?sun_keyboard_hack\>\)\| |
| 335 | \ \%(\%(\<no_\?\)\?trackall\>\)\|\%(\%(no_\?\)\?track_all\>\)\| |
| 336 | \ \%(\%(\<no_\?\)\?transientrprompt\>\)\|\%(\%(no_\?\)\?transient_rprompt\>\)\| |
| 337 | \ \%(\%(\<no_\?\)\?trapsasync\>\)\|\%(\%(no_\?\)\?traps_async\>\)\| |
| 338 | \ \%(\%(\<no_\?\)\?typesetsilent\>\)\|\%(\%(no_\?\)\?type_set_silent\>\)\|\%(\%(no_\?\)\?typeset_silent\>\)\| |
| 339 | \ \%(\%(\<no_\?\)\?unset\>\)\| |
| 340 | \ \%(\%(\<no_\?\)\?verbose\>\)\| |
| 341 | \ \%(\%(\<no_\?\)\?vi\>\)\| |
Bram Moolenaar | 96f45c0 | 2019-10-26 19:53:45 +0200 | [diff] [blame] | 342 | \ \%(\%(\<no_\?\)\?warnnestedvar\>\)\|\%(\%(no_\?\)\?warn_nested_var\>\)\| |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 343 | \ \%(\%(\<no_\?\)\?warncreateglobal\>\)\|\%(\%(no_\?\)\?warn_create_global\>\)\| |
| 344 | \ \%(\%(\<no_\?\)\?xtrace\>\)\| |
Bram Moolenaar | 2f05849 | 2017-11-30 20:27:52 +0100 | [diff] [blame] | 345 | \ \%(\%(\<no_\?\)\?zle\>\)/ nextgroup=zshOption,zshComment skipwhite contained |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 346 | |
Bram Moolenaar | 23515b4 | 2020-11-29 14:36:24 +0100 | [diff] [blame] | 347 | syn case match |
| 348 | |
Bram Moolenaar | 2f05849 | 2017-11-30 20:27:52 +0100 | [diff] [blame] | 349 | syn keyword zshTypes float integer local typeset declare private readonly |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 350 | |
| 351 | " XXX: this may be too much |
| 352 | " syn match zshSwitches '\s\zs--\=[a-zA-Z0-9-]\+' |
| 353 | |
| 354 | syn match zshNumber '[+-]\=\<\d\+\>' |
| 355 | syn match zshNumber '[+-]\=\<0x\x\+\>' |
| 356 | syn match zshNumber '[+-]\=\<0\o\+\>' |
| 357 | syn match zshNumber '[+-]\=\d\+#[-+]\=\w\+\>' |
| 358 | syn match zshNumber '[+-]\=\d\+\.\d\+\>' |
| 359 | |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 360 | " TODO: $[...] is the same as $((...)), so add that as well. |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 361 | syn cluster zshSubst contains=zshSubst,zshOldSubst,zshMathSubst |
Bram Moolenaar | b17893a | 2020-03-14 08:19:51 +0100 | [diff] [blame] | 362 | exe 'syn region zshSubst matchgroup=zshSubstDelim transparent start=/\$(/ skip=/\\)/ end=/)/ contains='.s:contained. ' fold' |
Bram Moolenaar | 681baaf | 2016-02-04 20:57:07 +0100 | [diff] [blame] | 363 | syn region zshParentheses transparent start='(' skip='\\)' end=')' fold |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 364 | syn region zshGlob start='(#' end=')' |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 365 | syn region zshMathSubst matchgroup=zshSubstDelim transparent |
Bram Moolenaar | 23515b4 | 2020-11-29 14:36:24 +0100 | [diff] [blame] | 366 | \ start='\%(\$\?\)[<=>]\@<!((' skip='\\)' end='))' |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 367 | \ contains=zshParentheses,@zshSubst,zshNumber, |
Bram Moolenaar | 681baaf | 2016-02-04 20:57:07 +0100 | [diff] [blame] | 368 | \ @zshDerefs,zshString keepend fold |
Bram Moolenaar | b17893a | 2020-03-14 08:19:51 +0100 | [diff] [blame] | 369 | " The ms=s+1 prevents matching zshBrackets several times on opening brackets |
| 370 | " (see https://github.com/chrisbra/vim-zsh/issues/21#issuecomment-576330348) |
| 371 | syn region zshBrackets contained transparent start='{'ms=s+1 skip='\\}' |
Bram Moolenaar | 681baaf | 2016-02-04 20:57:07 +0100 | [diff] [blame] | 372 | \ end='}' fold |
Bram Moolenaar | b17893a | 2020-03-14 08:19:51 +0100 | [diff] [blame] | 373 | exe 'syn region zshBrackets transparent start=/{/ms=s+1 skip=/\\}/ end=/}/ contains='.s:contained. ' fold' |
| 374 | |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 375 | syn region zshSubst matchgroup=zshSubstDelim start='\${' skip='\\}' |
Bram Moolenaar | 681baaf | 2016-02-04 20:57:07 +0100 | [diff] [blame] | 376 | \ end='}' contains=@zshSubst,zshBrackets,zshQuoted,zshString fold |
Bram Moolenaar | b17893a | 2020-03-14 08:19:51 +0100 | [diff] [blame] | 377 | exe 'syn region zshOldSubst matchgroup=zshSubstDelim start=/`/ skip=/\\[\\`]/ end=/`/ contains='.s:contained. ',zshOldSubst fold' |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 378 | |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 379 | syn sync minlines=50 maxlines=90 |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 380 | syn sync match zshHereDocSync grouphere NONE '<<-\=\s*\%(\\\=\S\+\|\(["']\)\S\+\1\)' |
| 381 | syn sync match zshHereDocEndSync groupthere NONE '^\s*EO\a\+\>' |
| 382 | |
Bram Moolenaar | 23515b4 | 2020-11-29 14:36:24 +0100 | [diff] [blame] | 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\).*$' |
| 392 | |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 393 | hi def link zshTodo Todo |
| 394 | hi def link zshComment Comment |
| 395 | hi def link zshPreProc PreProc |
| 396 | hi def link zshQuoted SpecialChar |
Bram Moolenaar | b17893a | 2020-03-14 08:19:51 +0100 | [diff] [blame] | 397 | hi def link zshPOSIXQuoted SpecialChar |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 398 | hi def link zshString String |
| 399 | hi def link zshStringDelimiter zshString |
| 400 | hi def link zshPOSIXString zshString |
| 401 | hi def link zshJobSpec Special |
| 402 | hi def link zshPrecommand Special |
| 403 | hi def link zshDelimiter Keyword |
| 404 | hi def link zshConditional Conditional |
| 405 | hi def link zshException Exception |
| 406 | hi def link zshRepeat Repeat |
| 407 | hi def link zshKeyword Keyword |
| 408 | hi def link zshFunction None |
| 409 | hi def link zshKSHFunction zshFunction |
| 410 | hi def link zshHereDoc String |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 411 | hi def link zshOperator None |
| 412 | hi def link zshRedir Operator |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 413 | hi def link zshVariable None |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 414 | hi def link zshVariableDef zshVariable |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 415 | hi def link zshDereferencing PreProc |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 416 | hi def link zshShortDeref zshDereferencing |
| 417 | hi def link zshLongDeref zshDereferencing |
| 418 | hi def link zshDeref zshDereferencing |
| 419 | hi def link zshDollarVar zshDereferencing |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 420 | hi def link zshCommands Keyword |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 421 | hi def link zshOptStart Keyword |
| 422 | hi def link zshOption Constant |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 423 | hi def link zshTypes Type |
| 424 | hi def link zshSwitches Special |
| 425 | hi def link zshNumber Number |
| 426 | hi def link zshSubst PreProc |
| 427 | hi def link zshMathSubst zshSubst |
| 428 | hi def link zshOldSubst zshSubst |
| 429 | hi def link zshSubstDelim zshSubst |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 430 | hi def link zshGlob zshSubst |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 431 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 432 | let b:current_syntax = "zsh" |
| 433 | |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 434 | let &cpo = s:cpo_save |
| 435 | unlet s:cpo_save |