summaryrefslogtreecommitdiff
path: root/runtime/syntax
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-02-25 00:00:01 +0100
committerBram Moolenaar <Bram@vim.org>2016-02-25 00:00:01 +0100
commitf391327adbbffb11180cf6038a92af1ed144e907 (patch)
treedb1b98159a3f1960dc7df8157fc9fd5cbf40435a /runtime/syntax
parent84f4996d2ab2982006d79ee69df4688c966bf8e8 (diff)
downloadvim-git-f391327adbbffb11180cf6038a92af1ed144e907.tar.gz
Updated runtime files.
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/sh.vim4
-rw-r--r--runtime/syntax/tex.vim64
-rw-r--r--runtime/syntax/vim.vim48
-rw-r--r--runtime/syntax/zsh.vim25
4 files changed, 76 insertions, 65 deletions
diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 15a00eb51..3fc236f03 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -2,8 +2,8 @@
" Language: shell (sh) Korn shell (ksh) bash (sh)
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
-" Last Change: Feb 16, 2016
-" Version: 144
+" Last Change: Feb 18, 2016
+" Version: 145
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
" For options and settings, please use: :help ft-sh-syntax
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr)
diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim
index 40013b5b9..cef28d65e 100644
--- a/runtime/syntax/tex.vim
+++ b/runtime/syntax/tex.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: TeX
" Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
-" Last Change: Jan 20, 2016
-" Version: 91
+" Last Change: Feb 18, 2016
+" Version: 92
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
"
" Notes: {{{1
@@ -200,7 +200,7 @@ if !exists("g:tex_no_math")
endif
" Try to flag {} and () mismatches: {{{1
-if s:tex_fast =~ 'm'
+if s:tex_fast =~# 'm'
if !s:tex_no_error
syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup,texError
syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup,texError,@NoSpell
@@ -217,7 +217,7 @@ endif
if !s:tex_no_error
syn match texError "[}\])]"
endif
-if s:tex_fast =~ 'M'
+if s:tex_fast =~# 'M'
if !exists("g:tex_no_math")
if !s:tex_no_error
syn match texMathError "}" contained
@@ -260,14 +260,14 @@ syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)$"
" \begin{}/\end{} section markers: {{{1
syn match texBeginEnd "\\begin\>\|\\end\>" nextgroup=texBeginEndName
-if s:tex_fast =~ 'm'
+if s:tex_fast =~# 'm'
syn region texBeginEndName matchgroup=Delimiter start="{" end="}" contained nextgroup=texBeginEndModifier contains=texComment
syn region texBeginEndModifier matchgroup=Delimiter start="\[" end="]" contained contains=texComment,@NoSpell
endif
" \documentclass, \documentstyle, \usepackage: {{{1
syn match texDocType "\\documentclass\>\|\\documentstyle\>\|\\usepackage\>" nextgroup=texBeginEndName,texDocTypeArgs
-if s:tex_fast =~ 'm'
+if s:tex_fast =~# 'm'
syn region texDocTypeArgs matchgroup=Delimiter start="\[" end="]" contained nextgroup=texBeginEndName contains=texComment,@NoSpell
endif
@@ -281,7 +281,7 @@ syn match texInput "\\input\s\+[a-zA-Z/.0-9_^]\+"hs=s+7 contains=texStatemen
syn match texInputFile "\\include\(graphics\|list\)\=\(\[.\{-}\]\)\=\s*{.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt
syn match texInputFile "\\\(epsfig\|input\|usepackage\)\s*\(\[.*\]\)\={.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt
syn match texInputCurlies "[{}]" contained
-if s:tex_fast =~ 'm'
+if s:tex_fast =~# 'm'
syn region texInputFileOpt matchgroup=Delimiter start="\[" end="\]" contained contains=texComment
endif
@@ -349,7 +349,7 @@ syn match texSpaceCode "\\\(math\|cat\|del\|lc\|sf\|uc\)code`"me=e-1 nextgroup=
syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained
" Sections, subsections, etc: {{{1
-if s:tex_fast =~ 'p'
+if s:tex_fast =~# 'p'
if !s:tex_nospell
TexFold syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell
TexFold syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup,@Spell
@@ -376,8 +376,8 @@ if s:tex_fast =~ 'p'
endif
" particular support for bold and italic {{{1
-if s:tex_fast =~ 'b'
- if s:tex_conceal =~ 'b'
+if s:tex_fast =~# 'b'
+ if s:tex_conceal =~# 'b'
if !exists("g:tex_nospell") || !g:tex_nospell
syn region texBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup,@Spell
syn region texBoldItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup,@Spell
@@ -414,7 +414,7 @@ if !exists("g:tex_no_math")
let foldcmd= ""
endif
exe "syn cluster texMathZones add=".grpname
- if s:tex_fast =~ 'M'
+ if s:tex_fast =~# 'M'
exe 'syn region '.grpname.' start='."'".'\\begin\s*{\s*'.a:mathzone.'\s*}'."'".' end='."'".'\\end\s*{\s*'.a:mathzone.'\s*}'."'".' keepend contains=@texMathZoneGroup'.foldcmd
exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"'
exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"'
@@ -424,7 +424,7 @@ if !exists("g:tex_no_math")
let grpname = "texMathZone".a:sfx.'S'
let syncname = "texSyncMathZone".a:sfx.'S'
exe "syn cluster texMathZones add=".grpname
- if s:tex_fast =~ 'M'
+ if s:tex_fast =~# 'M'
exe 'syn region '.grpname.' start='."'".'\\begin\s*{\s*'.a:mathzone.'\*\s*}'."'".' end='."'".'\\end\s*{\s*'.a:mathzone.'\*\s*}'."'".' keepend contains=@texMathZoneGroup'.foldcmd
exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"'
exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"'
@@ -448,8 +448,8 @@ if !exists("g:tex_no_math")
call TexNewMathZone("L","xxalignat",0)
" Inline Math Zones: {{{2
- if s:tex_fast =~ 'M'
- if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~ 'd'
+ if s:tex_fast =~# 'M'
+ if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~# 'd'
syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend concealends contains=@texMathZoneGroup
syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend concealends contains=@texMathZoneGroup
syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" concealends contains=@texMathZoneGroup
@@ -466,7 +466,7 @@ if !exists("g:tex_no_math")
syn match texMathOper "[_^=]" contained
" Text Inside Math Zones: {{{2
- if s:tex_fast =~ 'M'
+ if s:tex_fast =~# 'M'
if !exists("g:tex_nospell") || !g:tex_nospell
syn region texMathText matchgroup=texStatement start='\\\(\(inter\)\=text\|mbox\)\s*{' end='}' contains=@texFoldGroup,@Spell
else
@@ -476,7 +476,7 @@ if !exists("g:tex_no_math")
" \left..something.. and \right..something.. support: {{{2
syn match texMathDelimBad contained "\S"
- if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~ 'm'
+ if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~# 'm'
syn match texMathDelim contained "\\left\\{\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar={
syn match texMathDelim contained "\\right\\}\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar=}
let s:texMathDelimList=[
@@ -568,13 +568,13 @@ else
" allows syntax-folding of 2 or more contiguous comment lines
" single-line comments are not folded
syn match texComment "%.*$" contains=@texCommentGroup
- if s:tex_fast =~ 'c'
+ if s:tex_fast =~# 'c'
TexFold syn region texComment start="^\zs\s*%.*\_s*%" skip="^\s*%" end='^\ze\s*[^%]' contains=@texCommentGroup
TexFold syn region texNoSpell contained matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" contains=@texFoldGroup,@NoSpell
endif
else
syn match texComment "%.*$" contains=@texCommentGroup
- if s:tex_fast =~ 'c'
+ if s:tex_fast =~# 'c'
syn region texNoSpell contained matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" contains=@texFoldGroup,@NoSpell
endif
endif
@@ -583,7 +583,7 @@ endif
" Separate lines used for verb` and verb# so that the end conditions {{{1
" will appropriately terminate.
" If g:tex_verbspell exists, then verbatim texZones will permit spellchecking there.
-if s:tex_fast =~ 'v'
+if s:tex_fast =~# 'v'
if exists("g:tex_verbspell") && g:tex_verbspell
syn region texZone start="\\begin{[vV]erbatim}" end="\\end{[vV]erbatim}\|%stopzone\>" contains=@Spell
" listings package:
@@ -614,7 +614,7 @@ if s:tex_fast =~ 'v'
endif
" Tex Reference Zones: {{{1
-if s:tex_fast =~ 'r'
+if s:tex_fast =~# 'r'
syn region texZone matchgroup=texStatement start="@samp{" end="}\|%stopzone\>" contains=@texRefGroup
syn region texRefZone matchgroup=texStatement start="\\nocite{" end="}\|%stopzone\>" contains=@texRefGroup
syn region texRefZone matchgroup=texStatement start="\\bibliography{" end="}\|%stopzone\>" contains=@texRefGroup
@@ -628,13 +628,13 @@ syn match texRefZone '\\cite\%([tp]\*\=\)\=' nextgroup=texRefOption,texCite
" Handle newcommand, newenvironment : {{{1
syn match texNewCmd "\\newcommand\>" nextgroup=texCmdName skipwhite skipnl
-if s:tex_fast =~ 'V'
+if s:tex_fast =~# 'V'
syn region texCmdName contained matchgroup=Delimiter start="{"rs=s+1 end="}" nextgroup=texCmdArgs,texCmdBody skipwhite skipnl
syn region texCmdArgs contained matchgroup=Delimiter start="\["rs=s+1 end="]" nextgroup=texCmdBody skipwhite skipnl
syn region texCmdBody contained matchgroup=Delimiter start="{"rs=s+1 skip="\\\\\|\\[{}]" matchgroup=Delimiter end="}" contains=@texCmdGroup
endif
syn match texNewEnv "\\newenvironment\>" nextgroup=texEnvName skipwhite skipnl
-if s:tex_fast =~ 'V'
+if s:tex_fast =~# 'V'
syn region texEnvName contained matchgroup=Delimiter start="{"rs=s+1 end="}" nextgroup=texEnvBgn skipwhite skipnl
syn region texEnvBgn contained matchgroup=Delimiter start="{"rs=s+1 end="}" nextgroup=texEnvEnd skipwhite skipnl contains=@texEnvGroup
syn region texEnvEnd contained matchgroup=Delimiter start="{"rs=s+1 end="}" skipwhite skipnl contains=@texEnvGroup
@@ -660,11 +660,11 @@ syn match texString "\(``\|''\|,,\)"
" makeatletter -- makeatother sections
if !s:tex_no_error
- if s:tex_fast =~ 'S'
+ if s:tex_fast =~# 'S'
syn region texStyle matchgroup=texStatement start='\\makeatletter' end='\\makeatother' contains=@texStyleGroup contained
endif
syn match texStyleStatement "\\[a-zA-Z@]\+" contained
- if s:tex_fast =~ 'S'
+ if s:tex_fast =~# 'S'
syn region texStyleMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texStyleGroup,texError contained
syn region texStyleMatcher matchgroup=Delimiter start="\[" end="]" contains=@texStyleGroup,texError contained
endif
@@ -675,7 +675,7 @@ if has("conceal") && &enc == 'utf-8'
" Math Symbols {{{2
" (many of these symbols were contributed by Björn Winckler)
- if s:tex_conceal =~ 'm'
+ if s:tex_conceal =~# 'm'
let s:texMathList=[
\ ['|' , '‖'],
\ ['aleph' , 'ℵ'],
@@ -956,7 +956,7 @@ if has("conceal") && &enc == 'utf-8'
" \ ['uminus' , 'X']
" \ ['uplus' , 'X']
for texmath in s:texMathList
- if texmath[0] =~ '\w$'
+ if texmath[0] =~# '\w$'
exe "syn match texMathSymbol '\\\\".texmath[0]."\\>' contained conceal cchar=".texmath[1]
else
exe "syn match texMathSymbol '\\\\".texmath[0]."' contained conceal cchar=".texmath[1]
@@ -995,7 +995,7 @@ if has("conceal") && &enc == 'utf-8'
endif
" Greek {{{2
- if s:tex_conceal =~ 'g'
+ if s:tex_conceal =~# 'g'
fun! s:Greek(group,pat,cchar)
exe 'syn match '.a:group." '".a:pat."' contained conceal cchar=".a:cchar
endfun
@@ -1042,14 +1042,14 @@ if has("conceal") && &enc == 'utf-8'
endif
" Superscripts/Subscripts {{{2
- if s:tex_conceal =~ 's'
- if s:tex_fast =~ 's'
+ if s:tex_conceal =~# 's'
+ if s:tex_fast =~# 's'
syn region texSuperscript matchgroup=Delimiter start='\^{' skip="\\\\\|\\[{}]" end='}' contained concealends contains=texSpecialChar,texSuperscripts,texStatement,texSubscript,texSuperscript,texMathMatcher
syn region texSubscript matchgroup=Delimiter start='_{' skip="\\\\\|\\[{}]" end='}' contained concealends contains=texSpecialChar,texSubscripts,texStatement,texSubscript,texSuperscript,texMathMatcher
endif
" s:SuperSub:
fun! s:SuperSub(group,leader,pat,cchar)
- if a:pat =~ '^\\' || (a:leader == '\^' && a:pat =~ g:tex_superscripts) || (a:leader == '_' && a:pat =~ g:tex_subscripts)
+ if a:pat =~# '^\\' || (a:leader == '\^' && a:pat =~# g:tex_superscripts) || (a:leader == '_' && a:pat =~# g:tex_subscripts)
" call Decho("SuperSub: group<".a:group."> leader<".a:leader."> pat<".a:pat."> cchar<".a:cchar.">")
exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar
exe 'syn match '.a:group."s '".a:pat ."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s'
@@ -1154,7 +1154,7 @@ if has("conceal") && &enc == 'utf-8'
endif
" Accented characters: {{{2
- if s:tex_conceal =~ 'a'
+ if s:tex_conceal =~# 'a'
if b:tex_stylish
syn match texAccent "\\[bcdvuH][^a-zA-Z@]"me=e-1
syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)[^a-zA-Z@]"me=e-1
@@ -1169,7 +1169,7 @@ if has("conceal") && &enc == 'utf-8'
let i= i + 1
continue
endif
- if accent =~ '\a'
+ if accent =~# '\a'
exe "syn match texAccent '".'\\'.accent.'\(\s*{'.a:chr.'}\|\s\+'.a:chr.'\)'."' conceal cchar=".a:{i}
else
exe "syn match texAccent '".'\\'.accent.'\s*\({'.a:chr.'}\|'.a:chr.'\)'."' conceal cchar=".a:{i}
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index 9928051c2..0206a61e7 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -2,7 +2,7 @@
" Language: Vim 7.4 script
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
" Last Change: February 17, 2016
-" Version: 7.4-43
+" Version: 7.4-44
" Automatically generated keyword lists: {{{1
" Quit when a syntax file was already loaded {{{2
@@ -83,43 +83,43 @@ syn keyword vimFuncName contained add append arglistid assert_equal assert_false
" Special Vim Highlighting (not automatic) {{{1
" Set up folding commands
-if exists("g:vimsyn_folding") && g:vimsyn_folding =~ '[aflmpPrt]'
- if g:vimsyn_folding =~ 'a'
+if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[aflmpPrt]'
+ if g:vimsyn_folding =~# 'a'
com! -nargs=* VimFolda <args> fold
else
com! -nargs=* VimFolda <args>
endif
- if g:vimsyn_folding =~ 'f'
+ if g:vimsyn_folding =~# 'f'
com! -nargs=* VimFoldf <args> fold
else
com! -nargs=* VimFoldf <args>
endif
- if g:vimsyn_folding =~ 'l'
+ if g:vimsyn_folding =~# 'l'
com! -nargs=* VimFoldl <args> fold
else
com! -nargs=* VimFoldl <args>
endif
- if g:vimsyn_folding =~ 'm'
+ if g:vimsyn_folding =~# 'm'
com! -nargs=* VimFoldm <args> fold
else
com! -nargs=* VimFoldm <args>
endif
- if g:vimsyn_folding =~ 'p'
+ if g:vimsyn_folding =~# 'p'
com! -nargs=* VimFoldp <args> fold
else
com! -nargs=* VimFoldp <args>
endif
- if g:vimsyn_folding =~ 'P'
+ if g:vimsyn_folding =~# 'P'
com! -nargs=* VimFoldP <args> fold
else
com! -nargs=* VimFoldP <args>
endif
- if g:vimsyn_folding =~ 'r'
+ if g:vimsyn_folding =~# 'r'
com! -nargs=* VimFoldr <args> fold
else
com! -nargs=* VimFoldr <args>
endif
- if g:vimsyn_folding =~ 't'
+ if g:vimsyn_folding =~# 't'
com! -nargs=* VimFoldt <args> fold
else
com! -nargs=* VimFoldt <args>
@@ -190,7 +190,7 @@ syn keyword vimFTOption contained detect indent off on plugin
" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
syn cluster vimAugroupList contains=vimAugroup,vimIsCommand,vimCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimMap,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
-if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'a'
+if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a'
syn region vimAugroup fold matchgroup=vimAugroupKey start="\<aug\%[roup]\>\ze\s\+\K\k*" end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList
else
syn region vimAugroup matchgroup=vimAugroupKey start="\<aug\%[roup]\>\ze\s\+\K\k*" end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList
@@ -218,7 +218,7 @@ syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimF
syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
syn match vimFunction "\<fu\%[nction]!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
-if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'f'
+if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
syn region vimFuncBody contained fold start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\)" contains=@vimFuncBodyList
else
syn region vimFuncBody contained start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\)" contains=@vimFuncBodyList
@@ -611,12 +611,12 @@ syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' e
" Allows users to specify the type of embedded script highlighting
" they want: (perl/python/ruby/tcl support)
" g:vimsyn_embed == 0 : don't embed any scripts
-" g:vimsyn_embed =~ 'l' : embed lua (but only if vim supports it)
-" g:vimsyn_embed =~ 'm' : embed mzscheme (but only if vim supports it)
-" g:vimsyn_embed =~ 'p' : embed perl (but only if vim supports it)
-" g:vimsyn_embed =~ 'P' : embed python (but only if vim supports it)
-" g:vimsyn_embed =~ 'r' : embed ruby (but only if vim supports it)
-" g:vimsyn_embed =~ 't' : embed tcl (but only if vim supports it)
+" g:vimsyn_embed =~# 'l' : embed lua (but only if vim supports it)
+" g:vimsyn_embed =~# 'm' : embed mzscheme (but only if vim supports it)
+" g:vimsyn_embed =~# 'p' : embed perl (but only if vim supports it)
+" g:vimsyn_embed =~# 'P' : embed python (but only if vim supports it)
+" g:vimsyn_embed =~# 'r' : embed ruby (but only if vim supports it)
+" g:vimsyn_embed =~# 't' : embed tcl (but only if vim supports it)
if !exists("g:vimsyn_embed")
let g:vimsyn_embed= "lmpPr"
endif
@@ -631,7 +631,7 @@ if !filereadable(s:luapath)
endif
endfor
endif
-if (g:vimsyn_embed =~ 'l' && has("lua")) && filereadable(s:luapath)
+if (g:vimsyn_embed =~# 'l' && has("lua")) && filereadable(s:luapath)
unlet! b:current_syntax
exe "syn include @vimLuaScript ".s:luapath
VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimLuaScript
@@ -653,7 +653,7 @@ if !filereadable(s:perlpath)
endif
endfor
endif
-if (g:vimsyn_embed =~ 'p' && has("perl")) && filereadable(s:perlpath)
+if (g:vimsyn_embed =~# 'p' && has("perl")) && filereadable(s:perlpath)
unlet! b:current_syntax
exe "syn include @vimPerlScript ".s:perlpath
VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPerlScript
@@ -675,7 +675,7 @@ if !filereadable(s:rubypath)
endif
endfor
endif
-if (g:vimsyn_embed =~ 'r' && has("ruby")) && filereadable(s:rubypath)
+if (g:vimsyn_embed =~# 'r' && has("ruby")) && filereadable(s:rubypath)
unlet! b:current_syntax
exe "syn include @vimRubyScript ".s:rubypath
VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimRubyScript
@@ -697,7 +697,7 @@ if !filereadable(s:pythonpath)
endif
endfor
endif
-if g:vimsyn_embed =~ 'P' && (has("python") || has("python3")) && filereadable(s:pythonpath)
+if g:vimsyn_embed =~# 'P' && (has("python") || has("python3")) && filereadable(s:pythonpath)
unlet! b:current_syntax
exe "syn include @vimPythonScript ".s:pythonpath
VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript
@@ -728,7 +728,7 @@ if s:trytcl
endif
endfor
endif
- if (g:vimsyn_embed =~ 't' && has("tcl")) && filereadable(s:tclpath)
+ if (g:vimsyn_embed =~# 't' && has("tcl")) && filereadable(s:tclpath)
unlet! b:current_syntax
exe "syn include @vimTclScript ".s:tclpath
VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimTclScript
@@ -755,7 +755,7 @@ if !filereadable(s:mzschemepath)
endif
endfor
endif
-if (g:vimsyn_embed =~ 'm' && has("mzscheme")) && filereadable(s:mzschemepath)
+if (g:vimsyn_embed =~# 'm' && has("mzscheme")) && filereadable(s:mzschemepath)
unlet! b:current_syntax
let iskKeep= &isk
exe "syn include @vimMzSchemeScript ".s:mzschemepath
diff --git a/runtime/syntax/zsh.vim b/runtime/syntax/zsh.vim
index 25d4cd493..0d385a35d 100644
--- a/runtime/syntax/zsh.vim
+++ b/runtime/syntax/zsh.vim
@@ -2,7 +2,7 @@
" Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2016-01-25
+" Latest Revision: 2016-02-15
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh
@@ -13,20 +13,29 @@ endif
let s:cpo_save = &cpo
set cpo&vim
-setlocal iskeyword+=-
-setlocal foldmethod=syntax
+if v:version > 704 || (v:version == 704 && has("patch1142"))
+ syn iskeyword @,48-57,_,192-255,#,-
+else
+ setlocal iskeyword+=-
+endif
+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
+ \ contains=zshTodo,@Spell fold
+
+syn region zshComment start='^\s*#' end='^\%(\s*#\)\@!'
+ \ contains=zshTodo,@Spell fold
syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$'
syn match zshQuoted '\\.'
syn region zshString matchgroup=zshStringDelimiter start=+"+ end=+"+
- \ contains=zshQuoted,@zshDerefs,@zshSubst
-syn region zshString matchgroup=zshStringDelimiter start=+'+ end=+'+
+ \ contains=zshQuoted,@zshDerefs,@zshSubst fold
+syn region zshString matchgroup=zshStringDelimiter start=+'+ end=+'+ fold
" XXX: This should probably be more precise, but Zsh seems a bit confused about it itself
syn region zshPOSIXString matchgroup=zshStringDelimiter start=+\$'+
\ end=+'+ contains=zshQuoted
@@ -46,7 +55,7 @@ syn keyword zshException always
syn keyword zshKeyword function nextgroup=zshKSHFunction skipwhite
-syn match zshKSHFunction contained '\k\+'
+syn match zshKSHFunction contained '\w\S\+'
syn match zshFunction '^\s*\k\+\ze\s*()'
syn match zshOperator '||\|&&\|;\|&!\='
@@ -317,6 +326,8 @@ syn region zshMathSubst matchgroup=zshSubstDelim transparent
\ @zshDerefs,zshString keepend fold
syn region zshBrackets contained transparent start='{' skip='\\}'
\ end='}' fold
+syn region zshBrackets transparent start='{' skip='\\}'
+ \ end='}' contains=TOP fold
syn region zshSubst matchgroup=zshSubstDelim start='\${' skip='\\}'
\ end='}' contains=@zshSubst,zshBrackets,zshQuoted,zshString fold
syn region zshOldSubst matchgroup=zshSubstDelim start=+`+ skip=+\\`+