annotate runtime/syntax/zsh.vim @ 28923:2d726d5a6405 v8.2.4984

patch 8.2.4984: dragging statusline fails for window with winbar Commit: https://github.com/vim/vim/commit/6dab00aa5417f62f8c2c85c7c4ae871b4f1171f4 Author: zeertzjq <zeertzjq@outlook.com> Date: Fri May 20 13:45:59 2022 +0100 patch 8.2.4984: dragging statusline fails for window with winbar Problem: Dragging statusline fails for window with winbar. Solution: Fix off-by-one error. (closes https://github.com/vim/vim/issues/10448)
author Bram Moolenaar <Bram@vim.org>
date Fri, 20 May 2022 15:00:05 +0200
parents f0d7cb510ce3
children fee9eccee266
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
2 " Language: Zsh shell script
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
3 " Maintainer: Christian Brabandt <cb@256bit.org>
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
4 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
5 " Latest Revision: 2020-11-21
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
6 " License: Vim (see :h license)
11400
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
7 " Repository: https://github.com/chrisbra/vim-zsh
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
9 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
13 let s:cpo_save = &cpo
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
14 set cpo&vim
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
15
19646
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
16 function! s:ContainedGroup()
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
17 " needs 7.4.2008 for execute() function
19646
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
18 let result='TOP'
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
19 " vim-pandoc syntax defines the @langname cluster for embedded syntax languages
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
20 " However, if no syntax is defined yet, `syn list @zsh` will return
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
21 " "No syntax items defined", so make sure the result is actually a valid syn cluster
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
22 for cluster in ['markdownHighlightzsh', 'zsh']
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
23 try
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
24 " markdown syntax defines embedded clusters as @markdownhighlight<lang>,
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
25 " pandoc just uses @<lang>, so check both for both clusters
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
26 let a=split(execute('syn list @'. cluster), "\n")
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
27 if len(a) == 2 && a[0] =~# '^---' && a[1] =~? cluster
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
28 return '@'. cluster
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
29 endif
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
30 catch /E392/
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
31 " ignore
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
32 endtry
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
33 endfor
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
34 return result
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
35 endfunction
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
36
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
37 let s:contained=s:ContainedGroup()
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
38
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
39 syn iskeyword @,48-57,_,192-255,#,-
8246
f16bfe02cef1 commit https://github.com/vim/vim/commit/f391327adbbffb11180cf6038a92af1ed144e907
Christian Brabandt <cb@256bit.org>
parents: 7924
diff changeset
40 if get(g:, 'zsh_fold_enable', 0)
f16bfe02cef1 commit https://github.com/vim/vim/commit/f391327adbbffb11180cf6038a92af1ed144e907
Christian Brabandt <cb@256bit.org>
parents: 7924
diff changeset
41 setlocal foldmethod=syntax
f16bfe02cef1 commit https://github.com/vim/vim/commit/f391327adbbffb11180cf6038a92af1ed144e907
Christian Brabandt <cb@256bit.org>
parents: 7924
diff changeset
42 endif
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
43
26708
f0d7cb510ce3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23047
diff changeset
44 syn match zshQuoted '\\.'
19646
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
45 syn match zshPOSIXQuoted '\\[xX][0-9a-fA-F]\{1,2}'
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
46 syn match zshPOSIXQuoted '\\[0-7]\{1,3}'
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
47 syn match zshPOSIXQuoted '\\u[0-9a-fA-F]\{1,4}'
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
48 syn match zshPOSIXQuoted '\\U[1-9a-fA-F]\{1,8}'
26708
f0d7cb510ce3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23047
diff changeset
49
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
50 syn region zshString matchgroup=zshStringDelimiter start=+"+ end=+"+
8246
f16bfe02cef1 commit https://github.com/vim/vim/commit/f391327adbbffb11180cf6038a92af1ed144e907
Christian Brabandt <cb@256bit.org>
parents: 7924
diff changeset
51 \ contains=zshQuoted,@zshDerefs,@zshSubst fold
f16bfe02cef1 commit https://github.com/vim/vim/commit/f391327adbbffb11180cf6038a92af1ed144e907
Christian Brabandt <cb@256bit.org>
parents: 7924
diff changeset
52 syn region zshString matchgroup=zshStringDelimiter start=+'+ end=+'+ fold
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
53 syn region zshPOSIXString matchgroup=zshStringDelimiter start=+\$'+
19646
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
54 \ skip=+\\[\\']+ end=+'+ contains=zshPOSIXQuoted,zshQuoted
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
55 syn match zshJobSpec '%\(\d\+\|?\=\w\+\|[%+-]\)'
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
56
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
57 syn keyword zshPrecommand noglob nocorrect exec command builtin - time
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
58
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
59 syn keyword zshDelimiter do done end
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
60
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
61 syn keyword zshConditional if then elif else fi case in esac select
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
62
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
63 syn keyword zshRepeat while until repeat
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
64
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
65 syn keyword zshRepeat for foreach nextgroup=zshVariable skipwhite
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
66
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
67 syn keyword zshException always
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
68
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
69 syn keyword zshKeyword function nextgroup=zshKSHFunction skipwhite
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
70
8246
f16bfe02cef1 commit https://github.com/vim/vim/commit/f391327adbbffb11180cf6038a92af1ed144e907
Christian Brabandt <cb@256bit.org>
parents: 7924
diff changeset
71 syn match zshKSHFunction contained '\w\S\+'
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
72 syn match zshFunction '^\s*\k\+\ze\s*()'
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
73
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
74 syn match zshOperator '||\|&&\|;\|&!\='
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
76 syn match zshRedir '\d\=\(<\|<>\|<<<\|<&\s*[0-9p-]\=\)'
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
77 syn match zshRedir '\d\=\(>\|>>\|>&\s*[0-9p-]\=\|&>\|>>&\|&>>\)[|!]\='
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
78 syn match zshRedir '|&\='
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
79
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
80 syn region zshHereDoc matchgroup=zshRedir
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
81 \ start='<\@<!<<\s*\z([^<]\S*\)'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
82 \ end='^\z1\>'
13912
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12968
diff changeset
83 \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
84 syn region zshHereDoc matchgroup=zshRedir
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
85 \ start='<\@<!<<\s*\\\z(\S\+\)'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
86 \ end='^\z1\>'
13912
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12968
diff changeset
87 \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
88 syn region zshHereDoc matchgroup=zshRedir
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
89 \ start='<\@<!<<-\s*\\\=\z(\S\+\)'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
90 \ end='^\s*\z1\>'
13912
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12968
diff changeset
91 \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
92 syn region zshHereDoc matchgroup=zshRedir
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
93 \ start=+<\@<!<<\s*\(["']\)\z(\S\+\)\1+
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
94 \ end='^\z1\>'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
95 syn region zshHereDoc matchgroup=zshRedir
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
96 \ start=+<\@<!<<-\s*\(["']\)\z(\S\+\)\1+
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
97 \ end='^\s*\z1\>'
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
98
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
99 syn match zshVariable '\<\h\w*' contained
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
100
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
101 syn match zshVariableDef '\<\h\w*\ze+\=='
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
102 " XXX: how safe is this?
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
103 syn region zshVariableDef oneline
11400
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
104 \ start='\$\@<!\<\h\w*\[' end='\]\ze+\?=\?'
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
105 \ contains=@zshSubst
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
106
11400
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
107 syn cluster zshDerefs contains=zshShortDeref,zshLongDeref,zshDeref,zshDollarVar
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108
11400
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
109 syn match zshShortDeref '\$[!#$*@?_-]\w\@!'
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
110 syn match zshShortDeref '\$[=^~]*[#+]*\d\+\>'
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
111
11400
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
112 syn match zshLongDeref '\$\%(ARGC\|argv\|status\|pipestatus\|CPUTYPE\|EGID\|EUID\|ERRNO\|GID\|HOST\|LINENO\|LOGNAME\)'
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
113 syn match zshLongDeref '\$\%(MACHTYPE\|OLDPWD OPTARG\|OPTIND\|OSTYPE\|PPID\|PWD\|RANDOM\|SECONDS\|SHLVL\|signals\)'
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
114 syn match zshLongDeref '\$\%(TRY_BLOCK_ERROR\|TTY\|TTYIDLE\|UID\|USERNAME\|VENDOR\|ZSH_NAME\|ZSH_VERSION\|REPLY\|reply\|TERM\)'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115
11400
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
116 syn match zshDollarVar '\$\h\w*'
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
117 syn match zshDeref '\$[=^~]*[#+]*\h\w*\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
119 syn match zshCommands '\%(^\|\s\)[.:]\ze\s'
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
120 syn keyword zshCommands alias autoload bg bindkey break bye cap cd
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
121 \ chdir clone comparguments compcall compctl
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
122 \ compdescribe compfiles compgroups compquote
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
123 \ comptags comptry compvalues continue dirs
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
124 \ disable disown echo echotc echoti emulate
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
125 \ enable eval exec exit export false fc fg
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
126 \ functions getcap getln getopts hash history
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
127 \ jobs kill let limit log logout popd print
18456
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 13912
diff changeset
128 \ printf pushd pushln pwd r read
11400
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
129 \ rehash return sched set setcap shift
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
130 \ source stat suspend test times trap true
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
131 \ ttyctl type ulimit umask unalias unfunction
11400
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
132 \ unhash unlimit unset vared wait
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
133 \ whence where which zcompile zformat zftp zle
13912
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12968
diff changeset
134 \ zmodload zparseopts zprof zpty zrecompile
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12968
diff changeset
135 \ zregexparse zsocket zstyle ztcp
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
136
26708
f0d7cb510ce3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23047
diff changeset
137 " Options, generated by from the zsh source with the make-options.zsh script.
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
138 syn case ignore
26708
f0d7cb510ce3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23047
diff changeset
139 syn match zshOptStart
f0d7cb510ce3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23047
diff changeset
140 \ /\v^\s*%(%(un)?setopt|set\s+[-+]o)/
f0d7cb510ce3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23047
diff changeset
141 \ nextgroup=zshOption skipwhite
f0d7cb510ce3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23047
diff changeset
142 syn match zshOption nextgroup=zshOption,zshComment skipwhite contained /\v
f0d7cb510ce3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23047
diff changeset
143 \ <%(no_?)?%(
f0d7cb510ce3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23047
diff changeset
144 \ auto_?cd|auto_?pushd|cdable_?vars|cd_?silent|chase_?dots|chase_?links|posix_?cd|pushd_?ignore_?dups|pushd_?minus|pushd_?silent|pushd_?to_?home|always_?last_?prompt|always_?to_?end|auto_?list|auto_?menu|auto_?name_?dirs|auto_?param_?keys|auto_?param_?slash|auto_?remove_?slash|bash_?auto_?list|complete_?aliases|complete_?in_?word|glob_?complete|hash_?list_?all|list_?ambiguous|list_?beep|list_?packed|list_?rows_?first|list_?types|menu_?complete|rec_?exact|bad_?pattern|bare_?glob_?qual|brace_?ccl|case_?glob|case_?match|case_?paths|csh_?null_?glob|equals|extended_?glob|force_?float|glob|glob_?assign|glob_?dots|glob_?star_?short|glob_?subst|hist_?subst_?pattern|ignore_?braces|ignore_?close_?braces|ksh_?glob|magic_?equal_?subst|mark_?dirs|multibyte|nomatch|null_?glob|numeric_?glob_?sort|rc_?expand_?param|rematch_?pcre|sh_?glob|unset|warn_?create_?global|warn_?nested_?var|warnnestedvar|append_?history|bang_?hist|extended_?history|hist_?allow_?clobber|hist_?beep|hist_?expire_?dups_?first|hist_?fcntl_?lock|hist_?find_?no_?dups|hist_?ignore_?all_?dups|hist_?ignore_?dups|hist_?ignore_?space|hist_?lex_?words|hist_?no_?functions|hist_?no_?store|hist_?reduce_?blanks|hist_?save_?by_?copy|hist_?save_?no_?dups|hist_?verify|inc_?append_?history|inc_?append_?history_?time|share_?history|all_?export|global_?export|global_?rcs|rcs|aliases|clobber|clobber_?empty|correct|correct_?all|dvorak|flow_?control|ignore_?eof|interactive_?comments|hash_?cmds|hash_?dirs|hash_?executables_?only|mail_?warning|path_?dirs|path_?script|print_?eight_?bit|print_?exit_?value|rc_?quotes|rm_?star_?silent|rm_?star_?wait|short_?loops|short_?repeat|sun_?keyboard_?hack|auto_?continue|auto_?resume|bg_?nice|check_?jobs|check_?running_?jobs|hup|long_?list_?jobs|monitor|notify|posix_?jobs|prompt_?bang|prompt_?cr|prompt_?sp|prompt_?percent|prompt_?subst|transient_?rprompt|alias_?func_?def|c_?bases|c_?precedences|debug_?before_?cmd|err_?exit|err_?return|eval_?lineno|exec|function_?argzero|local_?loops|local_?options|local_?patterns|local_?traps|multi_?func_?def|multios|octal_?zeroes|pipe_?fail|source_?trace|typeset_?silent|typeset_?to_?unset|verbose|xtrace|append_?create|bash_?rematch|bsd_?echo|continue_?on_?error|csh_?junkie_?history|csh_?junkie_?loops|csh_?junkie_?quotes|csh_?nullcmd|ksh_?arrays|ksh_?autoload|ksh_?option_?print|ksh_?typeset|ksh_?zero_?subscript|posix_?aliases|posix_?argzero|posix_?builtins|posix_?identifiers|posix_?strings|posix_?traps|sh_?file_?expansion|sh_?nullcmd|sh_?option_?letters|sh_?word_?split|traps_?async|interactive|login|privileged|restricted|shin_?stdin|single_?command|beep|combining_?chars|emacs|overstrike|single_?line_?zle|vi|zle|brace_?expand|dot_?glob|hash_?all|hist_?append|hist_?expand|log|mail_?warn|one_?cmd|physical|prompt_?vars|stdin|track_?all|no_?match
f0d7cb510ce3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23047
diff changeset
145 \)>/
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
146 syn case match
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
147
12968
45987b1b77dc Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 11914
diff changeset
148 syn keyword zshTypes float integer local typeset declare private readonly
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
150 " XXX: this may be too much
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
151 " syn match zshSwitches '\s\zs--\=[a-zA-Z0-9-]\+'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
153 syn match zshNumber '[+-]\=\<\d\+\>'
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
154 syn match zshNumber '[+-]\=\<0x\x\+\>'
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
155 syn match zshNumber '[+-]\=\<0\o\+\>'
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
156 syn match zshNumber '[+-]\=\d\+#[-+]\=\w\+\>'
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
157 syn match zshNumber '[+-]\=\d\+\.\d\+\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
159 " TODO: $[...] is the same as $((...)), so add that as well.
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
160 syn cluster zshSubst contains=zshSubst,zshOldSubst,zshMathSubst
19646
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
161 exe 'syn region zshSubst matchgroup=zshSubstDelim transparent start=/\$(/ skip=/\\)/ end=/)/ contains='.s:contained. ' fold'
7924
00d64eb49ce1 commit https://github.com/vim/vim/commit/681baaf4a4c81418693dcafb81421a8614832e91
Christian Brabandt <cb@256bit.org>
parents: 7477
diff changeset
162 syn region zshParentheses transparent start='(' skip='\\)' end=')' fold
11400
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
163 syn region zshGlob start='(#' end=')'
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
164 syn region zshMathSubst matchgroup=zshSubstDelim transparent
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
165 \ start='\%(\$\?\)[<=>]\@<!((' skip='\\)' end='))'
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
166 \ contains=zshParentheses,@zshSubst,zshNumber,
26708
f0d7cb510ce3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23047
diff changeset
167 \ @zshDerefs,zshString fold
19646
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
168 " The ms=s+1 prevents matching zshBrackets several times on opening brackets
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
169 " (see https://github.com/chrisbra/vim-zsh/issues/21#issuecomment-576330348)
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
170 syn region zshBrackets contained transparent start='{'ms=s+1 skip='\\}'
7924
00d64eb49ce1 commit https://github.com/vim/vim/commit/681baaf4a4c81418693dcafb81421a8614832e91
Christian Brabandt <cb@256bit.org>
parents: 7477
diff changeset
171 \ end='}' fold
19646
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
172 exe 'syn region zshBrackets transparent start=/{/ms=s+1 skip=/\\}/ end=/}/ contains='.s:contained. ' fold'
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
173
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
174 syn region zshSubst matchgroup=zshSubstDelim start='\${' skip='\\}'
7924
00d64eb49ce1 commit https://github.com/vim/vim/commit/681baaf4a4c81418693dcafb81421a8614832e91
Christian Brabandt <cb@256bit.org>
parents: 7477
diff changeset
175 \ end='}' contains=@zshSubst,zshBrackets,zshQuoted,zshString fold
19646
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
176 exe 'syn region zshOldSubst matchgroup=zshSubstDelim start=/`/ skip=/\\[\\`]/ end=/`/ contains='.s:contained. ',zshOldSubst fold'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
178 syn sync minlines=50 maxlines=90
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
179 syn sync match zshHereDocSync grouphere NONE '<<-\=\s*\%(\\\=\S\+\|\(["']\)\S\+\1\)'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
180 syn sync match zshHereDocEndSync groupthere NONE '^\s*EO\a\+\>'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
181
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
182 syn keyword zshTodo contained TODO FIXME XXX NOTE
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
183
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
184 syn region zshComment oneline start='\%(^\|\s\+\)#' end='$'
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
185 \ contains=zshTodo,@Spell fold
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
186
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
187 syn region zshComment start='^\s*#' end='^\%(\s*#\)\@!'
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
188 \ contains=zshTodo,@Spell fold
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
189
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
190 syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$'
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
191
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
192 hi def link zshTodo Todo
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
193 hi def link zshComment Comment
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
194 hi def link zshPreProc PreProc
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
195 hi def link zshQuoted SpecialChar
19646
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
196 hi def link zshPOSIXQuoted SpecialChar
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
197 hi def link zshString String
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
198 hi def link zshStringDelimiter zshString
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
199 hi def link zshPOSIXString zshString
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
200 hi def link zshJobSpec Special
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
201 hi def link zshPrecommand Special
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
202 hi def link zshDelimiter Keyword
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
203 hi def link zshConditional Conditional
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
204 hi def link zshException Exception
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
205 hi def link zshRepeat Repeat
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
206 hi def link zshKeyword Keyword
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
207 hi def link zshFunction None
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
208 hi def link zshKSHFunction zshFunction
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
209 hi def link zshHereDoc String
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
210 hi def link zshOperator None
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
211 hi def link zshRedir Operator
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
212 hi def link zshVariable None
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1624
diff changeset
213 hi def link zshVariableDef zshVariable
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
214 hi def link zshDereferencing PreProc
11400
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
215 hi def link zshShortDeref zshDereferencing
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
216 hi def link zshLongDeref zshDereferencing
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
217 hi def link zshDeref zshDereferencing
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
218 hi def link zshDollarVar zshDereferencing
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
219 hi def link zshCommands Keyword
11400
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
220 hi def link zshOptStart Keyword
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
221 hi def link zshOption Constant
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
222 hi def link zshTypes Type
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
223 hi def link zshSwitches Special
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
224 hi def link zshNumber Number
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
225 hi def link zshSubst PreProc
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
226 hi def link zshMathSubst zshSubst
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
227 hi def link zshOldSubst zshSubst
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
228 hi def link zshSubstDelim zshSubst
11400
0f8713fe20dc Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 8246
diff changeset
229 hi def link zshGlob zshSubst
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 let b:current_syntax = "zsh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
233 let &cpo = s:cpo_save
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
234 unlet s:cpo_save