diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index e4311b3ba0..bb7ca77de7 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1019,7 +1019,7 @@ A string constant accepts these special characters: \X. same as \x. \u.... character specified with up to 4 hex numbers, stored according to the current value of 'encoding' (e.g., "\u02a4") -\U.... same as \u.... +\U.... same as \u but allows up to 8 hex numbers. \b backspace \e escape \f formfeed diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim index 71443abe5b..7eb963b7b2 100644 --- a/runtime/indent/html.vim +++ b/runtime/indent/html.vim @@ -2,7 +2,7 @@ " Header: "{{{ " Maintainer: Bram Moolenaar " Original Author: Andy Wokula -" Last Change: 2015 Jan 11 +" Last Change: 2015 Jun 12 " Version: 1.0 " Description: HTML indent script with cached state for faster indenting on a " range of lines. @@ -94,7 +94,7 @@ func! HtmlIndent_CheckUserSettings() let autotags = g:html_indent_autotags endif let b:hi_removed_tags = {} - if autotags + if len(autotags) > 0 call s:RemoveITags(b:hi_removed_tags, split(autotags, ",")) endif diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim index d2162dee5a..c608aeedeb 100644 --- a/runtime/syntax/python.vim +++ b/runtime/syntax/python.vim @@ -1,9 +1,8 @@ " Vim syntax file " Language: Python -" Maintainer: Neil Schemenauer -" Last Change: 2014 Jul 16 -" Credits: Zvezdan Petkovic -" Neil Schemenauer +" Maintainer: Zvezdan Petkovic +" Last Change: 2015 Jun 19 +" Credits: Neil Schemenauer " Dmitry Vasiliev " " This version is a major rewrite by Zvezdan Petkovic. @@ -95,16 +94,16 @@ syn match pythonComment "#.*$" contains=pythonTodo,@Spell syn keyword pythonTodo FIXME NOTE NOTES TODO XXX contained " Triple-quoted strings can contain doctests. -syn region pythonString +syn region pythonString matchgroup=pythonQuotes \ start=+[uU]\=\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1" \ contains=pythonEscape,@Spell -syn region pythonString +syn region pythonString matchgroup=pythonTripleQuotes \ start=+[uU]\=\z('''\|"""\)+ skip=+\\["']+ end="\z1" keepend \ contains=pythonEscape,pythonSpaceError,pythonDoctest,@Spell -syn region pythonRawString +syn region pythonRawString matchgroup=pythonQuotes \ start=+[uU]\=[rR]\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1" \ contains=@Spell -syn region pythonRawString +syn region pythonRawString matchgroup=pythonTripleQuotes \ start=+[uU]\=[rR]\z('''\|"""\)+ end="\z1" keepend \ contains=pythonSpaceError,pythonDoctest,@Spell @@ -113,7 +112,7 @@ syn match pythonEscape "\\\o\{1,3}" contained syn match pythonEscape "\\x\x\{2}" contained syn match pythonEscape "\%(\\u\x\{4}\|\\U\x\{8}\)" contained " Python allows case-insensitive Unicode IDs: http://www.unicode.org/charts/ -syn match pythonEscape "\\N{.\{-}}" contained +syn match pythonEscape "\\N{\a\+\%(\s\a\+\)*}" contained syn match pythonEscape "\\$" if exists("python_highlight_all") @@ -274,6 +273,8 @@ if version >= 508 || !exists("did_python_syn_inits") HiLink pythonTodo Todo HiLink pythonString String HiLink pythonRawString String + HiLink pythonQuotes String + HiLink pythonTripleQuotes pythonQuotes HiLink pythonEscape Special if !exists("python_no_number_highlight") HiLink pythonNumber Number diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index ad0df1f117..4087aff46e 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 " Previous Maintainer: Lennart Schultz -" Last Change: Apr 10, 2015 -" Version: 136 +" Last Change: May 29, 2015 +" Version: 137 " 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 ?ric Brunet (eric.brunet@ens.fr) @@ -17,7 +17,7 @@ elseif exists("b:current_syntax") endif " AFAICT "." should be considered part of the iskeyword. Using iskeywords in -" syntax is dicey, so the following code permits the user to prevent/override +" syntax is dicey, so the following code permits the user to " g:sh_isk set to a string : specify iskeyword. " g:sh_noisk exists : don't change iskeyword " g:sh_noisk does not exist : (default) append "." to iskeyword @@ -108,8 +108,7 @@ syn cluster shArithParenList contains=shArithmetic,shCaseEsac,shComment,shDeref, syn cluster shArithList contains=@shArithParenList,shParenError syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq -"syn cluster shColonList contains=@shCaseList -syn cluster shCommandSubList contains=shArithmetic,shDeref,shDerefSimple,shEcho,shEscape,shNumber,shOption,shPosnParm,shExSingleQuote,shSingleQuote,shExDoubleQuote,shDoubleQuote,shStatement,shVariable,shSubSh,shAlias,shTest,shCtrlSeq,shSpecial,shCmdParenRegion +syn cluster shCommandSubList contains=shAlias,shArithmetic,shCmdParenRegion,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shOption,shPosnParm,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shEscape,shPosnParm,shCtrlSeq,shSpecial syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPPS @@ -182,7 +181,7 @@ syn match shRedir "\d<<-\=" syn match shOperator "<<\|>>" contained syn match shOperator "[!&;|]" contained syn match shOperator "\[[[^:]\|\]]" contained -syn match shOperator "!\==" skipwhite nextgroup=shPattern +syn match shOperator "[-=/*+%]\==" skipwhite nextgroup=shPattern syn match shPattern "\<\S\+\())\)\@=" contained contains=shExSingleQuote,shSingleQuote,shExDoubleQuote,shDoubleQuote,shDeref " Subshells: {{{1 @@ -194,8 +193,8 @@ syn region shSubSh transparent matchgroup=shSubShRegion start="[^(]\zs(" end=")" "======= syn region shExpr matchgroup=shRange start="\[" skip=+\\\\\|\\$\|\[+ end="\]" contains=@shTestList,shSpecial syn region shTest transparent matchgroup=shStatement start="\" contained -syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shSetIdentifier -syn match shSetIdentifier "=" contained nextgroup=shCmdParenRegion,shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote +syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shVarAssign +syn match shVarAssign "=" contained nextgroup=shCmdParenRegion,shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote syn region shAtExpr contained start="@(" end=")" contains=@shIdList if exists("b:is_bash") syn region shSetList oneline matchgroup=shSet start="\<\(declare\|typeset\|local\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+#\|=" contains=@shIdList @@ -668,38 +668,38 @@ hi def link shStatement Statement hi def link shString String hi def link shTodo Todo hi def link shAlias Identifier -hi def link shRedir01 shRedir -hi def link shRedir02 shRedir -hi def link shRedir03 shRedir -hi def link shRedir04 shRedir -hi def link shRedir05 shRedir -hi def link shRedir06 shRedir -hi def link shRedir07 shRedir -hi def link shRedir08 shRedir -hi def link shRedir09 shRedir -hi def link shRedir10 shRedir -hi def link shRedir11 shRedir -hi def link shRedir12 shRedir -hi def link shRedir13 shRedir -hi def link shRedir14 shRedir -hi def link shRedir15 shRedir -hi def link shRedir16 shRedir -hi def link shRedir17 shRedir -hi def link shRedir18 shRedir -hi def link shRedir19 shRedir -hi def link shRedir20 shRedir -hi def link shRedir21 shRedir -hi def link shRedir22 shRedir -hi def link shRedir23 shRedir -hi def link shRedir24 shRedir -hi def link shRedir25 shRedir -hi def link shRedir26 shRedir -hi def link shRedir27 shRedir -hi def link shRedir28 shRedir -hi def link shRedir29 shRedir -hi def link shRedir30 shRedir -hi def link shRedir31 shRedir -hi def link shRedir32 shRedir +hi def link shHereDoc01 shRedir +hi def link shHereDoc02 shRedir +hi def link shHereDoc03 shRedir +hi def link shHereDoc04 shRedir +hi def link shHereDoc05 shRedir +hi def link shHereDoc06 shRedir +hi def link shHereDoc07 shRedir +hi def link shHereDoc08 shRedir +hi def link shHereDoc09 shRedir +hi def link shHereDoc10 shRedir +hi def link shHereDoc11 shRedir +hi def link shHereDoc12 shRedir +hi def link shHereDoc13 shRedir +hi def link shHereDoc14 shRedir +hi def link shHereDoc15 shRedir +hi def link shHereDoc16 shRedir +hi def link shHereDoc17 shRedir +hi def link shHereDoc18 shRedir +hi def link shHereDoc19 shRedir +hi def link shHereDoc20 shRedir +hi def link shHereDoc21 shRedir +hi def link shHereDoc22 shRedir +hi def link shHereDoc23 shRedir +hi def link shHereDoc24 shRedir +hi def link shHereDoc25 shRedir +hi def link shHereDoc26 shRedir +hi def link shHereDoc27 shRedir +hi def link shHereDoc28 shRedir +hi def link shHereDoc29 shRedir +hi def link shHereDoc30 shRedir +hi def link shHereDoc31 shRedir +hi def link shHereDoc32 shRedir " Set Current Syntax: {{{1 " =================== diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim index f704766877..b95ff4d8cb 100644 --- a/runtime/syntax/tex.vim +++ b/runtime/syntax/tex.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: TeX " Maintainer: Charles E. Campbell -" Last Change: Apr 02, 2015 -" Version: 84 +" Last Change: Jun 11, 2015 +" Version: 87 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX " " Notes: {{{1 @@ -207,7 +207,7 @@ if s:tex_fast =~ 'M' if !exists("s:tex_no_error") || !s:tex_no_error syn match texMathError "}" contained endif - syn region texMathMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\}" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup + syn region texMathMatcher matchgroup=Delimiter start="{" skip="\(\\\\\)*\\}" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup endif endif @@ -226,7 +226,7 @@ endif " TeX/LaTeX delimiters: {{{1 syn match texDelimiter "&" syn match texDelimiter "\\\\" -syn match texDelimiter "[{}]" +"%syn match texDelimiter "[{}]" " Tex/Latex Options: {{{1 syn match texOption "[^\\]\zs#\d\+\|^#\d\+" @@ -247,7 +247,7 @@ 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' - syn region texBeginEndName matchgroup=Delimiter start="{" end="}" contained nextgroup=texBeginEndModifier contains=texComment + syn region texBeginEndName matchgroup=Delimiter start="{" end="}" contained nextgroup=texBeginEndModifier contains=texComment syn region texBeginEndModifier matchgroup=Delimiter start="\[" end="]" contained contains=texComment,@NoSpell endif @@ -392,22 +392,22 @@ endif 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*\ze{" matchgroup=Delimiter end="}" concealends contains=@texBoldGroup,@Spell - syn region texBoldItalStyle matchgroup=texTypeStyle start="\\textit\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texItalGroup,@Spell - syn region texItalStyle matchgroup=texTypeStyle start="\\textit\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texItalGroup,@Spell - syn region texItalBoldStyle matchgroup=texTypeStyle start="\\textbf\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texBoldGroup,@Spell - else - syn region texBoldStyle matchgroup=texTypeStyle start="\\textbf\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texBoldGroup - syn region texBoldItalStyle matchgroup=texTypeStyle start="\\textit\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texItalGroup - syn region texItalStyle matchgroup=texTypeStyle start="\\textit\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texItalGroup - syn region texItalBoldStyle matchgroup=texTypeStyle start="\\textbf\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texBoldGroup + 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 + syn region texItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup,@Spell + syn region texItalBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup,@Spell + else + syn region texBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup + syn region texBoldItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup + syn region texItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup + syn region texItalBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup endif endif endif " Bad Math (mismatched): {{{1 if !exists("g:tex_no_math") && (!exists("s:tex_no_error") || !s:tex_no_error) - syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|subequations\|smallmatrix\|xxalignat\)\s*}" + syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|smallmatrix\|xxalignat\)\s*}" syn match texBadMath "\\end\s*{\s*\(align\|alignat\|displaymath\|displaymath\|eqnarray\|equation\|flalign\|gather\|math\|multline\|xalignat\)\*\=\s*}" syn match texBadMath "\\[\])]" endif @@ -456,24 +456,23 @@ if !exists("g:tex_no_math") call TexNewMathZone("G","gather",1) call TexNewMathZone("H","math",1) call TexNewMathZone("I","multline",1) - call TexNewMathZone("J","subequations",0) - call TexNewMathZone("K","xalignat",1) - call TexNewMathZone("L","xxalignat",0) + call TexNewMathZone("J","xalignat",1) + call TexNewMathZone("K","xxalignat",0) " Inline Math Zones: {{{2 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 - syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" concealends keepend contains=@texMathZoneGroup + 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 + syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend concealends contains=@texMathZoneGroup else - syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend contains=@texMathZoneGroup - syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend contains=@texMathZoneGroup - syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" contains=@texMathZoneGroup - syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend contains=@texMathZoneGroup + syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend contains=@texMathZoneGroup + syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend contains=@texMathZoneGroup + syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" contains=@texMathZoneGroup + syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend contains=@texMathZoneGroup endif - syn region texMathZoneZ matchgroup=texStatement start="\\ensuremath\s*{" matchgroup=texStatement end="}" end="%stopzone\>" contains=@texMathZoneGroup + syn region texMathZoneZ matchgroup=texStatement start="\\ensuremath\s*{" matchgroup=texStatement end="}" end="%stopzone\>" contains=@texMathZoneGroup endif syn match texMathOper "[_^=]" contained @@ -1062,11 +1061,12 @@ if has("conceal") && &enc == 'utf-8' 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) " 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' + exe 'syn match '.a:group."s '".a:pat ."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s' endif endfun call s:SuperSub('texSuperscript','\^','0','⁰')