Mercurial > vim
comparison runtime/syntax/zsh.vim @ 8246:f16bfe02cef1
commit https://github.com/vim/vim/commit/f391327adbbffb11180cf6038a92af1ed144e907
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 25 00:00:01 2016 +0100
Updated runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 25 Feb 2016 00:15:06 +0100 |
parents | 00d64eb49ce1 |
children | 0f8713fe20dc |
comparison
equal
deleted
inserted
replaced
8245:f8e9e537340c | 8246:f16bfe02cef1 |
---|---|
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: 2016-01-25 | 5 " Latest Revision: 2016-02-15 |
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 |
11 endif | 11 endif |
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 setlocal iskeyword+=- | 16 if v:version > 704 || (v:version == 704 && has("patch1142")) |
17 setlocal foldmethod=syntax | 17 syn iskeyword @,48-57,_,192-255,#,- |
18 else | |
19 setlocal iskeyword+=- | |
20 endif | |
21 if get(g:, 'zsh_fold_enable', 0) | |
22 setlocal foldmethod=syntax | |
23 endif | |
18 | 24 |
19 syn keyword zshTodo contained TODO FIXME XXX NOTE | 25 syn keyword zshTodo contained TODO FIXME XXX NOTE |
20 | 26 |
21 syn region zshComment oneline start='\%(^\|\s*\)#' end='$' | 27 syn region zshComment oneline start='\%(^\|\s*\)#' end='$' |
22 \ contains=zshTodo,@Spell | 28 \ contains=zshTodo,@Spell fold |
29 | |
30 syn region zshComment start='^\s*#' end='^\%(\s*#\)\@!' | |
31 \ contains=zshTodo,@Spell fold | |
23 | 32 |
24 syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$' | 33 syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$' |
25 | 34 |
26 syn match zshQuoted '\\.' | 35 syn match zshQuoted '\\.' |
27 syn region zshString matchgroup=zshStringDelimiter start=+"+ end=+"+ | 36 syn region zshString matchgroup=zshStringDelimiter start=+"+ end=+"+ |
28 \ contains=zshQuoted,@zshDerefs,@zshSubst | 37 \ contains=zshQuoted,@zshDerefs,@zshSubst fold |
29 syn region zshString matchgroup=zshStringDelimiter start=+'+ end=+'+ | 38 syn region zshString matchgroup=zshStringDelimiter start=+'+ end=+'+ fold |
30 " XXX: This should probably be more precise, but Zsh seems a bit confused about it itself | 39 " XXX: This should probably be more precise, but Zsh seems a bit confused about it itself |
31 syn region zshPOSIXString matchgroup=zshStringDelimiter start=+\$'+ | 40 syn region zshPOSIXString matchgroup=zshStringDelimiter start=+\$'+ |
32 \ end=+'+ contains=zshQuoted | 41 \ end=+'+ contains=zshQuoted |
33 syn match zshJobSpec '%\(\d\+\|?\=\w\+\|[%+-]\)' | 42 syn match zshJobSpec '%\(\d\+\|?\=\w\+\|[%+-]\)' |
34 | 43 |
44 | 53 |
45 syn keyword zshException always | 54 syn keyword zshException always |
46 | 55 |
47 syn keyword zshKeyword function nextgroup=zshKSHFunction skipwhite | 56 syn keyword zshKeyword function nextgroup=zshKSHFunction skipwhite |
48 | 57 |
49 syn match zshKSHFunction contained '\k\+' | 58 syn match zshKSHFunction contained '\w\S\+' |
50 syn match zshFunction '^\s*\k\+\ze\s*()' | 59 syn match zshFunction '^\s*\k\+\ze\s*()' |
51 | 60 |
52 syn match zshOperator '||\|&&\|;\|&!\=' | 61 syn match zshOperator '||\|&&\|;\|&!\=' |
53 | 62 |
54 syn match zshRedir '\d\=\(<\|<>\|<<<\|<&\s*[0-9p-]\=\)' | 63 syn match zshRedir '\d\=\(<\|<>\|<<<\|<&\s*[0-9p-]\=\)' |
315 \ matchgroup=zshSubstDelim end='))' | 324 \ matchgroup=zshSubstDelim end='))' |
316 \ contains=zshParentheses,@zshSubst,zshNumber, | 325 \ contains=zshParentheses,@zshSubst,zshNumber, |
317 \ @zshDerefs,zshString keepend fold | 326 \ @zshDerefs,zshString keepend fold |
318 syn region zshBrackets contained transparent start='{' skip='\\}' | 327 syn region zshBrackets contained transparent start='{' skip='\\}' |
319 \ end='}' fold | 328 \ end='}' fold |
329 syn region zshBrackets transparent start='{' skip='\\}' | |
330 \ end='}' contains=TOP fold | |
320 syn region zshSubst matchgroup=zshSubstDelim start='\${' skip='\\}' | 331 syn region zshSubst matchgroup=zshSubstDelim start='\${' skip='\\}' |
321 \ end='}' contains=@zshSubst,zshBrackets,zshQuoted,zshString fold | 332 \ end='}' contains=@zshSubst,zshBrackets,zshQuoted,zshString fold |
322 syn region zshOldSubst matchgroup=zshSubstDelim start=+`+ skip=+\\`+ | 333 syn region zshOldSubst matchgroup=zshSubstDelim start=+`+ skip=+\\`+ |
323 \ end=+`+ contains=TOP,zshOldSubst fold | 334 \ end=+`+ contains=TOP,zshOldSubst fold |
324 | 335 |