Mercurial > ec-dotfiles
changeset 636:8812b9230a68
Merge
author | nanaya <me@nanaya.pro> |
---|---|
date | Tue, 14 Jan 2020 11:09:50 +0900 |
parents | 5d3ce722285a (current diff) ced2ee9efd9f (diff) |
children | 758ced52ee62 |
files | rc/vimrc |
diffstat | 10 files changed, 1381 insertions(+), 986 deletions(-) [+] |
line wrap: on
line diff
--- a/rc/vimrc Mon Jan 13 00:19:42 2020 +0900 +++ b/rc/vimrc Tue Jan 14 11:09:50 2020 +0900 @@ -117,8 +117,7 @@ " stolen from https://github.com/leafgarland/typescript-vim/blob/master/ftdetect/typescript.vim " use `set filetype` to override default filetype=xml for *.ts files autocmd BufNewFile,BufRead *.ts set filetype=typescript - " use `setfiletype` to not override any other plugins like ianks/vim-tsx - autocmd BufNewFile,BufRead *.tsx setfiletype typescript + autocmd BufNewFile,BufRead *.tsx set filetype=typescriptreact autocmd BufRead,BufNewFile *.nginx set ft=nginx autocmd BufRead,BufNewFile */etc/nginx/* set ft=nginx @@ -136,6 +135,7 @@ autocmd FileType json call In2() autocmd FileType javascript call In2() autocmd FileType typescript call In2() + autocmd FileType typescript.tsx call In2() autocmd FileType nginx setlocal commentstring=#\ %s autocmd FileType nginx setlocal iskeyword& endif
--- a/update-vendor Mon Jan 13 00:19:42 2020 +0900 +++ b/update-vendor Tue Jan 14 11:09:50 2020 +0900 @@ -28,15 +28,17 @@ cd "$(dirname "$0")/vendor/vim-syntax" rm -f *.vim - _get https://bitbucket.org/vim-mirror/vim/raw/tip/runtime/syntax/eruby.vim - _get https://bitbucket.org/vim-mirror/vim/raw/tip/runtime/syntax/json.vim - _get https://bitbucket.org/vim-mirror/vim/raw/tip/runtime/syntax/less.vim - _get https://bitbucket.org/vim-mirror/vim/raw/tip/runtime/syntax/ruby.vim - _get https://bitbucket.org/vim-mirror/vim/raw/tip/runtime/syntax/scss.vim - _get https://github.com/kchmck/vim-coffee-script/raw/master/syntax/coffee.vim - _get https://github.com/slim-template/vim-slim/raw/master/syntax/slim.vim + _get https://hg.nginx.org/nginx/raw-file/tip/contrib/vim/syntax/nginx.vim _get https://raw.githubusercontent.com/jwalton512/vim-blade/master/syntax/blade.vim - _get https://hg.nginx.org/nginx/raw-file/tip/contrib/vim/syntax/nginx.vim - _get https://raw.githubusercontent.com/jelera/vim-javascript-syntax/master/syntax/javascript.vim - _get https://github.com/leafgarland/typescript-vim/raw/master/syntax/typescript.vim + _get https://raw.githubusercontent.com/kchmck/vim-coffee-script/master/syntax/coffee.vim + _get https://raw.githubusercontent.com/slim-template/vim-slim/master/syntax/slim.vim + _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/css.vim + _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/eruby.vim + _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/javascript.vim + _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/json.vim + _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/less.vim + _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/ruby.vim + _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/scss.vim + _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/typescript.vim + _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/typescriptreact.vim )
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/vim-syntax/css.vim Tue Jan 14 11:09:50 2020 +0900 @@ -0,0 +1,650 @@ +" Vim syntax file +" Language: Cascading Style Sheets +" Previous Contributor List: +" Claudio Fleiner <claudio@fleiner.com> (Maintainer) +" Yeti (Add full CSS2, HTML4 support) +" Nikolai Weibull (Add CSS2 support) +" URL: https://github.com/JulesWang/css.vim +" Maintainer: Jules Wang <w.jq0722@gmail.com> +" Last Change: 2019 Jul. 29 + +" quit when a syntax file was already loaded +if !exists("main_syntax") + if exists("b:current_syntax") + finish + endif + let main_syntax = 'css' +elseif exists("b:current_syntax") && b:current_syntax == "css" + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +syn case ignore + +" HTML4 tags +syn keyword cssTagName abbr address area a b base +syn keyword cssTagName bdo blockquote body br button +syn keyword cssTagName caption cite code col colgroup dd del +syn keyword cssTagName dfn div dl dt em fieldset form +syn keyword cssTagName h1 h2 h3 h4 h5 h6 head hr html img i +syn keyword cssTagName iframe input ins isindex kbd label legend li +syn keyword cssTagName link map menu meta noscript ol optgroup +syn keyword cssTagName option p param pre q s samp script small +syn keyword cssTagName span strong sub sup tbody td +syn keyword cssTagName textarea tfoot th thead title tr ul u var +syn keyword cssTagName object svg +syn match cssTagName /\<select\>\|\<style\>\|\<table\>/ + +" 34 HTML5 tags +syn keyword cssTagName article aside audio bdi canvas command data +syn keyword cssTagName datalist details dialog embed figcaption figure footer +syn keyword cssTagName header hgroup keygen main mark menuitem meter nav +syn keyword cssTagName output progress rt rp ruby section +syn keyword cssTagName source summary time track video wbr + +" Tags not supported in HTML5 +" acronym applet basefont big center dir +" font frame frameset noframes strike tt + +syn match cssTagName "\*" + +" selectors +syn match cssSelectorOp "[,>+~]" +syn match cssSelectorOp2 "[~|^$*]\?=" contained +syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ + +" .class and #id +syn match cssClassName "\.-\=[A-Za-z_][A-Za-z0-9_-]*" contains=cssClassNameDot +syn match cssClassNameDot contained '\.' + +try +syn match cssIdentifier "#[A-Za-zĄ-’_@][A-Za-zĄ-’0-9_@-]*" +catch /^.*/ +syn match cssIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*" +endtry + +" digits +syn match cssValueInteger contained "[-+]\=\d\+" contains=cssUnitDecorators +syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\=" contains=cssUnitDecorators +syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\|fr\|vw\|vh\|vmin\|vmax\)\>" contains=cssUnitDecorators +syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=%" contains=cssUnitDecorators +syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)\>" contains=cssUnitDecorators +syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)\>" contains=cssUnitDecorators +syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)\>" contains=cssUnitDecorators + +" The 16 basic color names +syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow + +" 130 more color names +syn keyword cssColor contained aliceblue antiquewhite aquamarine azure +syn keyword cssColor contained beige bisque blanchedalmond blueviolet brown burlywood +syn keyword cssColor contained cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan +syn match cssColor contained /\<dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)\>/ +syn match cssColor contained /\<dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)\>/ +syn match cssColor contained /\<darkslate\(blue\|gray\|grey\)\>/ +syn match cssColor contained /\<dark\(turquoise\|violet\)\>/ +syn keyword cssColor contained deeppink deepskyblue dimgray dimgrey dodgerblue firebrick +syn keyword cssColor contained floralwhite forestgreen gainsboro ghostwhite gold +syn keyword cssColor contained goldenrod greenyellow grey honeydew hotpink +syn keyword cssColor contained indianred indigo ivory khaki lavender lavenderblush lawngreen +syn keyword cssColor contained lemonchiffon limegreen linen magenta +syn match cssColor contained /\<light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)\>/ +syn match cssColor contained /\<light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)\>/ +syn match cssColor contained /\<light\(slategray\|slategrey\|steelblue\)\>/ +syn match cssColor contained /\<medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)\>/ +syn match cssColor contained /\<medium\(slateblue\|springgreen\|turquoise\|violetred\)\>/ +syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajowhite +syn keyword cssColor contained oldlace olivedrab orange orangered orchid +syn match cssColor contained /\<pale\(goldenrod\|green\|turquoise\|violetred\)\>/ +syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue +syn keyword cssColor contained rosybrown royalblue rebeccapurple saddlebrown salmon +syn keyword cssColor contained sandybrown seagreen seashell sienna skyblue slateblue +syn keyword cssColor contained slategray slategrey snow springgreen steelblue tan +syn keyword cssColor contained thistle tomato turquoise violet wheat +syn keyword cssColor contained whitesmoke yellowgreen + +" FIXME: These are actually case-insensitive too, but (a) specs recommend using +" mixed-case (b) it's hard to highlight the word `Background' correctly in +" all situations +syn case match +syn keyword cssColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFace ButtonHighlight ButtonShadow ButtonText CaptionText GrayText Highlight HighlightText InactiveBorder InactiveCaption InactiveCaptionText InfoBackground InfoText Menu MenuText Scrollbar ThreeDDarkShadow ThreeDFace ThreeDHighlight ThreeDLightShadow ThreeDShadow Window WindowFrame WindowText Background +syn case ignore + +syn match cssImportant contained "!\s*important\>" +syn match cssCustomProp contained "--[a-zA-Z0-9-_]*" + +syn match cssColor contained "\<transparent\>" +syn match cssColor contained "\<currentColor\>" +syn match cssColor contained "\<white\>" +syn match cssColor contained "#\x\{3,4\}\>" contains=cssUnitDecorators +syn match cssColor contained "#\x\{6\}\>" contains=cssUnitDecorators +syn match cssColor contained "#\x\{8\}\>" contains=cssUnitDecorators + +syn region cssURL contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline +syn region cssFunction contained matchgroup=cssFunctionName start="\<\(var\|calc\)\s*(" end=")" contains=cssCustomProp,cssValue.*,cssFunction,cssColor,cssStringQ,cssStringQQ oneline +syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma +syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction +syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma +syn region cssFunction contained matchgroup=cssFunctionName start="\<\(matrix\(3d\)\=\|scale\(3d\|X\|Y\|Z\)\=\|translate\(3d\|X\|Y\|Z\)\=\|skew\(X\|Y\)\=\|rotate\(3d\|X\|Y\|Z\)\=\|perspective\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma +syn keyword cssGradientAttr contained top bottom left right cover center middle ellipse at +syn match cssFunctionComma contained "," + +" Common Prop and Attr +syn keyword cssCommonAttr contained auto none inherit all default normal +syn keyword cssCommonAttr contained top bottom center stretch hidden visible +"------------------------------------------------ +" CSS Animations +" http://www.w3.org/TR/css3-animations/ +syn match cssAnimationProp contained "\<animation\(-\(delay\|direction\|duration\|fill-mode\|name\|play-state\|timing-function\|iteration-count\)\)\=\>" + +" animation-direction attributes +syn keyword cssAnimationAttr contained alternate reverse +syn match cssAnimationAttr contained "\<alternate-reverse\>" + +" animation-fill-mode attributes +syn keyword cssAnimationAttr contained forwards backwards both + +" animation-play-state attributes +syn keyword cssAnimationAttr contained running paused + +" animation-iteration-count attributes +syn keyword cssAnimationAttr contained infinite +"------------------------------------------------ +" CSS Backgrounds and Borders Module Level 3 +" http://www.w3.org/TR/css3-background/ +syn match cssBackgroundProp contained "\<background\(-\(attachment\|clip\|color\|image\|origin\|position\|repeat\|size\)\)\=\>" +" background-attachment attributes +syn keyword cssBackgroundAttr contained scroll fixed local + +" background-position attributes +syn keyword cssBackgroundAttr contained left center right top bottom + +" background-repeat attributes +syn match cssBackgroundAttr contained "\<no-repeat\>" +syn match cssBackgroundAttr contained "\<repeat\(-[xy]\)\=\>" + +" background-size attributes +syn keyword cssBackgroundAttr contained cover contain + +syn match cssBorderProp contained "\<border\(-\(top\|right\|bottom\|left\)\)\=\(-\(width\|color\|style\)\)\=\>" +syn match cssBorderProp contained "\<border\(-\(top\|bottom\)-\(left\|right\)\)\=-radius\>" +syn match cssBorderProp contained "\<border-image\(-\(outset\|repeat\|slice\|source\|width\)\)\=\>" +syn match cssBorderProp contained "\<box-decoration-break\>" +syn match cssBorderProp contained "\<box-shadow\>" + +" border-image attributes +syn keyword cssBorderAttr contained stretch round fill + +" border-style attributes +syn keyword cssBorderAttr contained dotted dashed solid double groove ridge inset outset + +" border-width attributes +syn keyword cssBorderAttr contained thin thick medium + +" box-decoration-break attributes +syn keyword cssBorderAttr contained clone slice +"------------------------------------------------ + +syn match cssBoxProp contained "\<padding\(-\(top\|right\|bottom\|left\)\)\=\>" +syn match cssBoxProp contained "\<margin\(-\(top\|right\|bottom\|left\)\)\=\>" +syn match cssBoxProp contained "\<overflow\(-\(x\|y\|style\)\)\=\>" +syn match cssBoxProp contained "\<rotation\(-point\)\=\>" +syn keyword cssBoxAttr contained visible hidden scroll auto +syn match cssBoxAttr contained "\<no-\(display\|content\)\>" + +syn keyword cssCascadeProp contained all +syn keyword cssCascadeAttr contained initial unset revert + +syn keyword cssColorProp contained opacity +syn match cssColorProp contained "\<color-profile\>" +syn match cssColorProp contained "\<rendering-intent\>" + + +syn match cssDimensionProp contained "\<\(min\|max\)-\(width\|height\)\>" +syn keyword cssDimensionProp contained height +syn keyword cssDimensionProp contained width + +" CSS Flexible Box Layout Module Level 1 +" http://www.w3.org/TR/css3-flexbox/ +" CSS Box Alignment Module Level 3 +" http://www.w3.org/TR/css-align-3/ +syn match cssFlexibleBoxProp contained "\<flex\(-\(direction\|wrap\|flow\|grow\|shrink\|basis\)\)\=\>" +syn match cssFlexibleBoxProp contained "\<\(align\|justify\)\(-\(items\|self\|content\)\)\=\>" +syn keyword cssFlexibleBoxProp contained order + +syn match cssFlexibleBoxAttr contained "\<\(row\|column\|wrap\)\(-reverse\)\=\>" +syn keyword cssFlexibleBoxAttr contained nowrap stretch baseline center +syn match cssFlexibleBoxAttr contained "\<flex\(-\(start\|end\)\)\=\>" +syn match cssFlexibleBoxAttr contained "\<space\(-\(between\|around\)\)\=\>" + +" CSS Fonts Module Level 3 +" http://www.w3.org/TR/css-fonts-3/ +syn match cssFontProp contained "\<font\(-\(family\|\|feature-settings\|kerning\|language-override\|size\(-adjust\)\=\|stretch\|style\|synthesis\|variant\(-\(alternates\|caps\|east-asian\|ligatures\|numeric\|position\)\)\=\|weight\)\)\=\>" + +" font attributes +syn keyword cssFontAttr contained icon menu caption +syn match cssFontAttr contained "\<message-box\>" +syn match cssFontAttr contained "\<status-bar\>" +syn keyword cssFontAttr contained larger smaller +syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>" +syn match cssFontAttr contained "\<small-\(caps\|caption\)\>" +" font-family attributes +syn match cssFontAttr contained "\<\(sans-\)\=serif\>" +syn keyword cssFontAttr contained Antiqua Arial Black Book Charcoal Comic Courier Dingbats Gadget Geneva Georgia Grande Helvetica Impact Linotype Lucida MS Monaco Neue New Palatino Roboto Roman Symbol Tahoma Times Trebuchet Verdana Webdings Wingdings York Zapf +syn keyword cssFontAttr contained cursive fantasy monospace +" font-feature-settings attributes +syn keyword cssFontAttr contained on off +" font-stretch attributes +syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>" +" font-style attributes +syn keyword cssFontAttr contained italic oblique +" font-synthesis attributes +syn keyword cssFontAttr contained weight style +" font-weight attributes +syn keyword cssFontAttr contained bold bolder lighter +" TODO: font-variant-* attributes +"------------------------------------------------ + +" Webkit specific property/attributes +syn match cssFontProp contained "\<font-smooth\>" +syn match cssFontAttr contained "\<\(subpixel-\)\=\antialiased\>" + + +" CSS Multi-column Layout Module +" http://www.w3.org/TR/css3-multicol/ +syn match cssMultiColumnProp contained "\<break-\(after\|before\|inside\)\>" +syn match cssMultiColumnProp contained "\<column-\(count\|fill\|gap\|rule\(-\(color\|style\|width\)\)\=\|span\|width\)\>" +syn keyword cssMultiColumnProp contained columns +syn keyword cssMultiColumnAttr contained balance medium +syn keyword cssMultiColumnAttr contained always left right page column +syn match cssMultiColumnAttr contained "\<avoid\(-\(page\|column\)\)\=\>" + +" http://www.w3.org/TR/css3-break/#page-break +syn match cssMultiColumnProp contained "\<page\(-break-\(before\|after\|inside\)\)\=\>" + +" http://www.w3.org/TR/SVG11/interact.html +syn match cssInteractProp contained "\<pointer-events\>" +syn match cssInteractAttr contained "\<\(visible\)\=\(Painted\|Fill\|Stroke\)\=\>" + +" TODO find following items in w3c docs. +syn keyword cssGeneratedContentProp contained quotes crop +syn match cssGeneratedContentProp contained "\<counter-\(reset\|increment\)\>" +syn match cssGeneratedContentProp contained "\<move-to\>" +syn match cssGeneratedContentProp contained "\<page-policy\>" +syn match cssGeneratedContentAttr contained "\<\(no-\)\=\(open\|close\)-quote\>" + +" https://www.w3.org/TR/css-grid-1/ +syn match cssGridProp contained "\<grid\>" +syn match cssGridProp contained "\<grid-template\(-\(columns\|rows\|areas\)\)\=\>" +syn match cssGridProp contained "\<grid-\(column\|row\)\(-\(start\|end\|gap\)\)\=\>" +syn match cssGridProp contained "\<grid-\(area\|gap\)\>" +syn match cssGridProp contained "\<grid-auto-\(flow\|rows\|columns\)\>" + +syn match cssHyerlinkProp contained "\<target\(-\(name\|new\|position\)\)\=\>" + +syn match cssListProp contained "\<list-style\(-\(type\|position\|image\)\)\=\>" +syn match cssListAttr contained "\<\(lower\|upper\)-\(roman\|alpha\|greek\|latin\)\>" +syn match cssListAttr contained "\<\(hiragana\|katakana\)\(-iroha\)\=\>" +syn match cssListAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic\)\>" +syn keyword cssListAttr contained disc circle square hebrew armenian georgian +syn keyword cssListAttr contained inside outside + +syn keyword cssPositioningProp contained bottom clear clip display float left +syn keyword cssPositioningProp contained position right top visibility +syn match cssPositioningProp contained "\<z-index\>" +syn keyword cssPositioningAttr contained block compact grid +syn match cssPositioningAttr contained "\<table\(-\(row-group\|\(header\|footer\)-group\|row\|column\(-group\)\=\|cell\|caption\)\)\=\>" +syn keyword cssPositioningAttr contained left right both +syn match cssPositioningAttr contained "\<list-item\>" +syn match cssPositioningAttr contained "\<inline\(-\(block\|box\|table\|grid\|flex\)\)\=\>" +syn match cssPositioningAttr contained "\<flow\(-root\)\=\>" +syn keyword cssPositioningAttr contained static relative absolute fixed subgrid + +syn keyword cssPrintAttr contained landscape portrait crop cross always + +syn match cssTableProp contained "\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\)\>" +syn keyword cssTableAttr contained fixed collapse separate show hide once always + + +syn keyword cssTextProp contained color direction hyphens +syn match cssTextProp "\<\(\(word\|letter\)-spacing\|text\(-\(decoration\|transform\|align\|index\|shadow\)\)\=\|vertical-align\|unicode-bidi\|line-height\)\>" +syn match cssTextProp contained "\<text-\(justify\|outline\|warp\|align-last\|size-adjust\|rendering\|stroke\|indent\)\>" +syn match cssTextProp contained "\<\(word\|line\)-break\|\(overflow\|word\)-wrap\>" +syn match cssTextProp contained "\<white-space\>" +syn match cssTextProp contained "\<hanging-punctuation\>" +syn match cssTextProp contained "\<tab-size\>" +syn match cssTextProp contained "\<punctuation-trim\>" +syn match cssTextAttr contained "\<line-through\>" +syn match cssTextAttr contained "\<\(text-\)\=\(top\|bottom\)\>" +syn keyword cssTextAttr contained ltr rtl embed nowrap +syn keyword cssTextAttr contained underline overline blink sub super middle +syn keyword cssTextAttr contained capitalize uppercase lowercase +syn keyword cssTextAttr contained justify baseline sub super +syn keyword cssTextAttr contained optimizeLegibility optimizeSpeed geometricPrecision +syn match cssTextAttr contained "\<pre\(-\(line\|wrap\)\)\=\>" +syn match cssTextAttr contained "\<\(allow\|force\)-end\>" +syn keyword cssTextAttr contained start end adjacent +syn match cssTextAttr contained "\<inter-\(word\|ideographic\|cluster\)\>" +syn keyword cssTextAttr contained distribute kashida first last +syn keyword cssTextAttr contained clip ellipsis unrestricted suppress +syn match cssTextAttr contained "\<break-all\>" +syn match cssTextAttr contained "\<break-word\>" +syn keyword cssTextAttr contained manual +syn match cssTextAttr contained "\<bidi-override\>" + +syn match cssTransformProp contained "\<transform\(-\(origin\|style\)\)\=\>" +syn match cssTransformProp contained "\<perspective\(-origin\)\=\>" +syn match cssTransformProp contained "\<backface-visibility\>" + +" CSS Transitions +" http://www.w3.org/TR/css3-transitions/ +syn match cssTransitionProp contained "\<transition\(-\(delay\|duration\|property\|timing-function\)\)\=\>" + +" transition-time-function attributes +syn match cssTransitionAttr contained "\<linear\(-gradient\)\@!\>" +syn match cssTransitionAttr contained "\<ease\(-\(in-out\|out\|in\)\)\=\>" +syn match cssTransitionAttr contained "\<step\(-start\|-end\)\=\>" +"------------------------------------------------ +" CSS Basic User Interface Module Level 3 (CSS3 UI) +" http://www.w3.org/TR/css3-ui/ +syn match cssUIProp contained "\<box-sizing\>" +syn match cssUIAttr contained "\<\(content\|padding\|border\)\(-box\)\=\>" + +syn keyword cssUIProp contained cursor +syn match cssUIAttr contained "\<\(\([ns]\=[ew]\=\)\|col\|row\|nesw\|nwse\)-resize\>" +syn keyword cssUIAttr contained crosshair help move pointer alias copy +syn keyword cssUIAttr contained progress wait text cell move +syn match cssUIAttr contained "\<context-menu\>" +syn match cssUIAttr contained "\<no-drop\>" +syn match cssUIAttr contained "\<not-allowed\>" +syn match cssUIAttr contained "\<all-scroll\>" +syn match cssUIAttr contained "\<\(vertical-\)\=text\>" +syn match cssUIAttr contained "\<zoom\(-in\|-out\)\=\>" + +syn match cssUIProp contained "\<ime-mode\>" +syn keyword cssUIAttr contained active inactive disabled + +syn match cssUIProp contained "\<nav-\(down\|index\|left\|right\|up\)\=\>" +syn match cssUIProp contained "\<outline\(-\(width\|style\|color\|offset\)\)\=\>" +syn keyword cssUIAttr contained invert + +syn keyword cssUIProp contained icon resize +syn keyword cssUIAttr contained both horizontal vertical + +syn match cssUIProp contained "\<text-overflow\>" +syn keyword cssUIAttr contained clip ellipsis + +syn match cssUIProp contained "\<image-rendering\>" +syn keyword cssUIAttr contained pixellated +syn match cssUIAttr contained "\<crisp-edges\>" + +"------------------------------------------------ +" Webkit/iOS specific attributes +syn match cssUIAttr contained '\<preserve-3d\>' +" IE specific attributes +syn match cssIEUIAttr contained '\<bicubic\>' + +" Webkit/iOS specific properties +syn match cssUIProp contained '\<tap-highlight-color\|user-select\|touch-callout\>' +" IE specific properties +syn match cssIEUIProp contained '\<interpolation-mode\|zoom\|filter\>' + +" Webkit/Firebox specific properties/attributes +syn keyword cssUIProp contained appearance +syn keyword cssUIAttr contained window button field icon document menu + + +syn match cssAuralProp contained "\<\(pause\|cue\)\(-\(before\|after\)\)\=\>" +syn match cssAuralProp contained "\<\(play-during\|speech-rate\|voice-family\|pitch\(-range\)\=\|speak\(-\(punctuation\|numeral\|header\)\)\=\)\>" +syn keyword cssAuralProp contained volume during azimuth elevation stress richness +syn match cssAuralAttr contained "\<\(x-\)\=\(soft\|loud\)\>" +syn keyword cssAuralAttr contained silent +syn match cssAuralAttr contained "\<spell-out\>" +syn keyword cssAuralAttr contained non mix +syn match cssAuralAttr contained "\<\(left\|right\)-side\>" +syn match cssAuralAttr contained "\<\(far\|center\)-\(left\|center\|right\)\>" +syn keyword cssAuralAttr contained leftwards rightwards behind +syn keyword cssAuralAttr contained below level above lower higher +syn match cssAuralAttr contained "\<\(x-\)\=\(slow\|fast\|low\|high\)\>" +syn keyword cssAuralAttr contained faster slower +syn keyword cssAuralAttr contained male female child code digits continuous + +" mobile text +syn match cssMobileTextProp contained "\<text-size-adjust\>" + +syn keyword cssMediaProp contained width height orientation scan +syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio/ +syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/ +syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/ +syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/ +syn keyword cssMediaAttr contained portrait landscape progressive interlace +syn match cssKeyFrameProp contained /\(\d\+\(\.\d\+\)\?%\|\(\<from\|to\>\)\)/ nextgroup=cssDefinition +syn match cssPageMarginProp /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition +syn keyword cssPageProp contained content size +syn keyword cssPageProp contained orphans widows +syn keyword cssFontDescriptorProp contained src +syn match cssFontDescriptorProp contained "\<unicode-range\>" +" unicode-range attributes +syn match cssFontDescriptorAttr contained "U+[0-9A-Fa-f?]\+" +syn match cssFontDescriptorAttr contained "U+\x\+-\x\+" + +syn match cssBraces contained "[{}]" +syn match cssError contained "{@<>" +syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=cssTagName,cssAttributeSelector,cssClassName,cssIdentifier,cssAtRule,cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssCustomProp,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,cssNoise fold +syn match cssBraceError "}" +syn match cssAttrComma "," + +" Pseudo class +" http://www.w3.org/TR/css3-selectors/ +syn match cssPseudoClass ":[A-Za-z0-9_-]*" contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn +syn keyword cssPseudoClassId contained link visited active hover before after left right +syn keyword cssPseudoClassId contained root empty target enable disabled checked invalid +syn match cssPseudoClassId contained "\<first-\(line\|letter\)\>" +syn match cssPseudoClassId contained "\<\(first\|last\|only\)-\(of-type\|child\)\>" +syn region cssPseudoClassFn contained matchgroup=cssFunctionName start="\<\(not\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(" end=")" contains=cssStringQ,cssStringQQ +" ------------------------------------ +" Vendor specific properties +syn match cssPseudoClassId contained "\<selection\>" +syn match cssPseudoClassId contained "\<focus\(-inner\)\=\>" +syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>" + +" Misc highlight groups +syntax match cssUnitDecorators /\(#\|-\|+\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|ch\|rem\|vh\|vw\|vmin\|vmax\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)/ contained +syntax match cssNoise contained /\(:\|;\|\/\)/ + +" Comment +syn region cssComment start="/\*" end="\*/" contains=@Spell fold + +syn match cssUnicodeEscape "\\\x\{1,6}\s\?" +syn match cssSpecialCharQQ +\\\\\|\\"+ contained +syn match cssSpecialCharQ +\\\\\|\\'+ contained +syn region cssStringQQ start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cssUnicodeEscape,cssSpecialCharQQ +syn region cssStringQ start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=cssUnicodeEscape,cssSpecialCharQ + +" Vendor Prefix +syn match cssVendor contained "-\(webkit\|moz\|o\|ms\)-" + +" Various CSS Hack characters +" In earlier versions of IE (6 and 7), one can prefix property names +" with a _ or * to isolate those definitions to particular versions of IE +" This is purely decorative and therefore we assign to the same highlight +" group to cssVendor, for more information: +" http://www.paulirish.com/2009/browser-specific-css-hacks/ +syn match cssHacks contained /\(_\|*\)/ + +" Attr Enhance +" Some keywords are both Prop and Attr, so we have to handle them +" cssPseudoClassId is hidden by cssAttrRegion, so we add it here. see #69 +syn region cssAttrRegion start=/:/ end=/\ze\(;\|)\|}\|{\)/ contained contains=cssPseudoClassId,css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise + +" Hack for transition +" 'transition' has Props after ':'. +syn region cssAttrRegion start=/transition\s*:/ end=/\ze\(;\|)\|}\)/ contained contains=css.*Prop,css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise + +syn match cssAtKeyword /@\(font-face\|media\|keyframes\|import\|charset\|namespace\|page\|supports\)/ + +syn keyword cssAtRuleLogical only not and contained + +" @media +" Reference: http://www.w3.org/TR/css3-mediaqueries/ +syn region cssAtRule start=/@media\>/ end=/\ze{/ skipwhite skipnl matchgroup=cssAtKeyword contains=cssMediaProp,cssValueLength,cssAtRuleLogical,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType,cssComment,cssCustomProp,cssFunctionName nextgroup=cssDefinition +syn keyword cssMediaType contained screen print aural braille embossed handheld projection tty tv speech all contained + +" @page +" http://www.w3.org/TR/css3-page/ +syn region cssAtRule start=/@page\>/ end=/\ze{/ skipwhite skipnl matchgroup=cssAtKeyword contains=cssPagePseudo,cssComment nextgroup=cssDefinition +syn match cssPagePseudo /:\(left\|right\|first\|blank\)/ contained skipwhite skipnl +" @keyframe +" http://www.w3.org/TR/css3-animations/#keyframes +syn region cssAtRule start=/@\(-[a-z]\+-\)\=keyframes\>/ end=/\ze{/ skipwhite skipnl matchgroup=cssAtKeyword contains=cssVendor,cssComment nextgroup=cssDefinition + +syn region cssAtRule start=/@import\>/ end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssAtKeyword,cssURL,cssMediaProp,cssValueLength,cssAtRuleLogical,cssValueInteger,cssMediaAttr,cssMediaType +syn region cssAtRule start=/@charset\>/ end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssAtKeyword +syn region cssAtRule start=/@namespace\>/ end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssAtKeyword + +" @supports +" https://www.w3.org/TR/css3-conditional/#at-supports +syn region cssAtRule start=/@supports\>/ end=/\ze{/ skipwhite skipnl contains=cssAtRuleLogical,cssAttrRegion,css.*Prop,cssValue.*,cssVendor,cssAtKeyword,cssComment nextgroup=cssDefinition + + +if main_syntax == "css" + syn sync minlines=10 +endif + +" Define the default highlighting. +" Only when an item doesn't have highlighting yet + +hi def link cssComment Comment +hi def link cssVendor Comment +hi def link cssHacks Comment +hi def link cssTagName Statement +hi def link cssDeprecated Error +hi def link cssSelectorOp Special +hi def link cssSelectorOp2 Special +hi def link cssAttrComma Special + +hi def link cssAnimationProp cssProp +hi def link cssBackgroundProp cssProp +hi def link cssBorderProp cssProp +hi def link cssBoxProp cssProp +hi def link cssCascadeProp cssProp +hi def link cssColorProp cssProp +hi def link cssContentForPagedMediaProp cssProp +hi def link cssDimensionProp cssProp +hi def link cssFlexibleBoxProp cssProp +hi def link cssFontProp cssProp +hi def link cssGeneratedContentProp cssProp +hi def link cssGridProp cssProp +hi def link cssHyerlinkProp cssProp +hi def link cssInteractProp cssProp +hi def link cssLineboxProp cssProp +hi def link cssListProp cssProp +hi def link cssMarqueeProp cssProp +hi def link cssMultiColumnProp cssProp +hi def link cssPagedMediaProp cssProp +hi def link cssPositioningProp cssProp +hi def link cssPrintProp cssProp +hi def link cssRubyProp cssProp +hi def link cssSpeechProp cssProp +hi def link cssTableProp cssProp +hi def link cssTextProp cssProp +hi def link cssTransformProp cssProp +hi def link cssTransitionProp cssProp +hi def link cssUIProp cssProp +hi def link cssIEUIProp cssProp +hi def link cssAuralProp cssProp +hi def link cssRenderProp cssProp +hi def link cssMobileTextProp cssProp + +hi def link cssAnimationAttr cssAttr +hi def link cssBackgroundAttr cssAttr +hi def link cssBorderAttr cssAttr +hi def link cssBoxAttr cssAttr +hi def link cssContentForPagedMediaAttr cssAttr +hi def link cssDimensionAttr cssAttr +hi def link cssFlexibleBoxAttr cssAttr +hi def link cssFontAttr cssAttr +hi def link cssGeneratedContentAttr cssAttr +hi def link cssGridAttr cssAttr +hi def link cssHyerlinkAttr cssAttr +hi def link cssInteractAttr cssAttr +hi def link cssLineboxAttr cssAttr +hi def link cssListAttr cssAttr +hi def link cssMarginAttr cssAttr +hi def link cssMarqueeAttr cssAttr +hi def link cssMultiColumnAttr cssAttr +hi def link cssPaddingAttr cssAttr +hi def link cssPagedMediaAttr cssAttr +hi def link cssPositioningAttr cssAttr +hi def link cssGradientAttr cssAttr +hi def link cssPrintAttr cssAttr +hi def link cssRubyAttr cssAttr +hi def link cssSpeechAttr cssAttr +hi def link cssTableAttr cssAttr +hi def link cssTextAttr cssAttr +hi def link cssTransformAttr cssAttr +hi def link cssTransitionAttr cssAttr +hi def link cssUIAttr cssAttr +hi def link cssIEUIAttr cssAttr +hi def link cssAuralAttr cssAttr +hi def link cssRenderAttr cssAttr +hi def link cssCascadeAttr cssAttr +hi def link cssCommonAttr cssAttr + +hi def link cssPseudoClassId PreProc +hi def link cssPseudoClassLang Constant +hi def link cssValueLength Number +hi def link cssValueInteger Number +hi def link cssValueNumber Number +hi def link cssValueAngle Number +hi def link cssValueTime Number +hi def link cssValueFrequency Number +hi def link cssFunction Constant +hi def link cssURL String +hi def link cssFunctionName Function +hi def link cssFunctionComma Function +hi def link cssColor Constant +hi def link cssIdentifier Function +hi def link cssAtRule Include +hi def link cssAtKeyword PreProc +hi def link cssImportant Special +hi def link cssCustomProp Special +hi def link cssBraces Function +hi def link cssBraceError Error +hi def link cssError Error +hi def link cssUnicodeEscape Special +hi def link cssStringQQ String +hi def link cssStringQ String +hi def link cssAttributeSelector String +hi def link cssMediaType Special +hi def link cssMediaComma Normal +hi def link cssAtRuleLogical Statement +hi def link cssMediaProp cssProp +hi def link cssMediaAttr cssAttr +hi def link cssPagePseudo PreProc +hi def link cssPageMarginProp cssAtKeyword +hi def link cssPageProp cssProp +hi def link cssKeyFrameProp Constant +hi def link cssFontDescriptor Special +hi def link cssFontDescriptorProp cssProp +hi def link cssFontDescriptorAttr cssAttr +hi def link cssUnicodeRange Constant +hi def link cssClassName Function +hi def link cssClassNameDot Function +hi def link cssProp StorageClass +hi def link cssAttr Constant +hi def link cssUnitDecorators Number +hi def link cssNoise Noise + +let b:current_syntax = "css" + +if main_syntax == 'css' + unlet main_syntax +endif + +let &cpo = s:cpo_save +unlet s:cpo_save +" vim: ts=8 +
--- a/vendor/vim-syntax/javascript.vim Mon Jan 13 00:19:42 2020 +0900 +++ b/vendor/vim-syntax/javascript.vim Tue Jan 14 11:09:50 2020 +0900 @@ -1,310 +1,134 @@ " Vim syntax file -" Language: JavaScript -" Maintainer: Jose Elera Campana <https://github.com/jelera> -" Last Modified: Wed 24 Feb 2016 03:35:03 AM CST -" Version: 0.8.2 -" Credits: Zhao Yi, Claudio Fleiner, Scott Shattuck (This file is based -" on their hard work), gumnos (From the #vim IRC Channel in -" Freenode), all the contributors at this project's github page -" (https://github.com/jelera/vim-javascript-syntax/graphs/contributors) +" Language: JavaScript +" Maintainer: Claudio Fleiner <claudio@fleiner.com> +" Updaters: Scott Shattuck (ss) <ss@technicalpursuit.com> +" URL: http://www.fleiner.com/vim/syntax/javascript.vim +" Changes: (ss) added keywords, reserved words, and other identifiers +" (ss) repaired several quoting and grouping glitches +" (ss) fixed regex parsing issue with multiple qualifiers [gi] +" (ss) additional factoring of keywords, globals, and members +" Last Change: 2019 Sep 27 +" 2013 Jun 12: adjusted javaScriptRegexpString (Kevin Locke) +" 2018 Apr 14: adjusted javaScriptRegexpString (LongJohnCoder) + +" tuning parameters: +" unlet javaScript_fold if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") - finish - endif - let main_syntax = 'javascript' -endif - -" Drop fold if it set but vim doesn't support it. -if version < 600 && exists("javaScript_fold") - unlet javaScript_fold -endif - -"" Remove dollar sign from identifier when embedded in a PHP file -if &filetype == 'javascript' - setlocal iskeyword+=$ + " quit when a syntax file was already loaded + if exists("b:current_syntax") + finish + endif + let main_syntax = 'javascript' +elseif exists("b:current_syntax") && b:current_syntax == "javascript" + finish endif -syntax sync fromstart +let s:cpo_save = &cpo +set cpo&vim -"" syntax coloring for Node.js shebang line -syntax match shebang "^#!.*" -hi link shebang Comment -" Statement Keywords {{{ -syntax keyword javaScriptSource import export from -syntax keyword javaScriptIdentifier arguments this let var void yield async await const -syntax keyword javaScriptOperator delete new instanceof typeof -syntax keyword javaScriptBoolean true false -syntax keyword javaScriptNull null undefined -syntax keyword javaScriptMessage alert confirm prompt status -syntax keyword javaScriptGlobal self top parent -syntax keyword javaScriptDeprecated escape unescape all applets alinkColor bgColor fgColor linkColor vlinkColor xmlEncoding -syntax keyword javaScriptConditional if else switch -syntax keyword javaScriptRepeat do while for in of -syntax keyword javaScriptBranch break continue -syntax keyword javaScriptLabel case default -syntax keyword javaScriptPrototype prototype -syntax keyword javaScriptStatement return with -syntax keyword javaScriptGlobalObjects Array Boolean Date Function Math Number Object RegExp String -syntax keyword javaScriptExceptions try catch throw finally Error EvalError RangeError ReferenceError SyntaxError TypeError URIError -syntax keyword javaScriptReserved abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws goto private transient debugger implements protected volatile double import public -"}}} -" Comments {{{ -syntax keyword javaScriptCommentTodo TODO FIXME XXX TBD OPTIMIZE HACK REVIEW contained -syntax match javaScriptLineComment "\/\/.*" contains=@Spell,javaScriptCommentTodo -syntax match javaScriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)" -syntax region javaScriptComment start="/\*" end="\*/" contains=@Spell,javaScriptCommentTodo -"}}} -" JSDoc support {{{ -if !exists("javascript_ignore_javaScriptdoc") - syntax case ignore +syn keyword javaScriptCommentTodo TODO FIXME XXX TBD contained +syn match javaScriptLineComment "\/\/.*" contains=@Spell,javaScriptCommentTodo +syn match javaScriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)" +syn region javaScriptComment start="/\*" end="\*/" contains=@Spell,javaScriptCommentTodo +syn match javaScriptSpecial "\\\d\d\d\|\\." +syn region javaScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=javaScriptSpecial,@htmlPreproc +syn region javaScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=javaScriptSpecial,@htmlPreproc +syn region javaScriptStringT start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=javaScriptSpecial,javaScriptEmbed,@htmlPreproc - " syntax coloring for JSDoc comments (HTML) - "unlet b:current_syntax - - syntax region javaScriptDocComment matchgroup=javaScriptComment start="/\*\*\s*$" end="\*/" contains=javaScriptDocTags,javaScriptCommentTodo,@javaScriptHtml,jsInJsdocExample,@Spell fold - syntax match javaScriptDocTags contained "@\(abstract\|access\|alias\|arg\|argument\|augments\|author\|borrows\|callback\|class\|classdesc\|const\|constant\|constructor\|constructs\|copyright\|default\|defaultvalue\|deprecated\|desc\|description\|emits\|enum\|event\|example\|exception\|exports\|extends\|external\|file\|fileoverview\|fires\|func\|function\|global\|host\|ignore\|implements\|inheritdoc\|inner\|instance\|interface\|kind\|lends\|license\|link\|linkcode\|linkplain\|listens\|member\|memberof\|method\|mixes\|mixin\|module\|name\|namespace\|override\|overview\|param\|private\|prop\|property\|cfg\|protected\|public\|readonly\|requires\|return\|returns\|see\|since\|static\|summary\|this\|throws\|todo\|tutorial\|tutorial\|type\|typedef\|var\|variation\|version\|virtual\)\>" nextgroup=javaScriptDocParam,javaScriptDocSeeTag skipwhite - syntax match javaScriptDocParam contained "\%(#\|\w\|\.\|:\|\/\)\+" - syntax region javaScriptDocSeeTag contained matchgroup=javaScriptDocSeeTag start="{" end="}" contains=javaScriptDocTags +syn region javaScriptEmbed start=+${+ end=+}+ contains=@javaScriptEmbededExpr - syntax case match -endif - syntax case match -"}}} -" Strings, Numbers and Regex Highlight {{{ -syntax match javaScriptSpecial "\\\d\d\d\|\\." -syntax region javaScriptString start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=javaScriptSpecial,@htmlPreproc -syntax region javaScriptString start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=javaScriptSpecial,@htmlPreproc - -syntax match javaScriptSpecialCharacter "'\\.'" -syntax match javaScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>" -syntax region javaScriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gim]\{0,2\}\s*$+ end=+/[gim]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline -syntax match javaScriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/ -"}}} -" DOM, Browser and Ajax Support {{{ -syntax keyword javaScriptBrowserObjects window navigator screen history location console - -syntax keyword javaScriptDOMObjects document event HTMLElement Anchor Area Base Body Button Form Frame Frameset Image Link Meta Option Select Style Table TableCell TableRow Textarea -syntax keyword javaScriptDOMMethods createTextNode createElement insertBefore replaceChild removeChild appendChild hasChildNodes cloneNode normalize isSupported hasAttributes getAttribute setAttribute removeAttribute getAttributeNode setAttributeNode removeAttributeNode getElementsByTagName hasAttribute getElementById adoptNode close compareDocumentPosition createAttribute createCDATASection createComment createDocumentFragment createElementNS createEvent createExpression createNSResolver createProcessingInstruction createRange createTreeWalker elementFromPoint evaluate getBoxObjectFor getElementsByClassName getSelection getUserData hasFocus importNode -syntax keyword javaScriptDOMProperties nodeName nodeValue nodeType parentNode childNodes firstChild lastChild previousSibling nextSibling attributes ownerDocument namespaceURI prefix localName tagName +syn match javaScriptSpecialCharacter "'\\.'" +syn match javaScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>" +syn region javaScriptRegexpString start=+[,(=+]\s*/[^/*]+ms=e-1,me=e-1 skip=+\\\\\|\\/+ end=+/[gimuys]\{0,2\}\s*$+ end=+/[gimuys]\{0,2\}\s*[+;.,)\]}]+me=e-1 end=+/[gimuys]\{0,2\}\s\+\/+me=e-1 contains=@htmlPreproc,javaScriptComment oneline -syntax keyword javaScriptAjaxObjects XMLHttpRequest -syntax keyword javaScriptAjaxProperties readyState responseText responseXML statusText -syntax keyword javaScriptAjaxMethods onreadystatechange abort getAllResponseHeaders getResponseHeader open send setRequestHeader - -syntax keyword javaScriptPropietaryObjects ActiveXObject -syntax keyword javaScriptPropietaryMethods attachEvent detachEvent cancelBubble returnValue - -syntax keyword javaScriptHtmlElemProperties className clientHeight clientLeft clientTop clientWidth dir href id innerHTML lang length offsetHeight offsetLeft offsetParent offsetTop offsetWidth scrollHeight scrollLeft scrollTop scrollWidth style tabIndex target title - -syntax keyword javaScriptEventListenerKeywords blur click focus mouseover mouseout load item - -syntax keyword javaScriptEventListenerMethods scrollIntoView addEventListener dispatchEvent removeEventListener preventDefault stopPropagation -" }}} -" DOM/HTML5/CSS specified things {{{ - " Web API Interfaces (very long list of keywords) {{{ - syntax keyword javaScriptWebAPI AbstractWorker AnalyserNode AnimationEvent App Apps ArrayBuffer ArrayBufferView Attr AudioBuffer AudioBufferSourceNode AudioContext AudioDestinationNode AudioListener AudioNode AudioParam AudioProcessingEvent BatteryManager BiquadFilterNode Blob BlobBuilder BlobEvent CallEvent CameraCapabilities CameraControl CameraManager CanvasGradient CanvasImageSource CanvasPattern CanvasPixelArray CanvasRenderingContext2D CaretPosition CDATASection ChannelMergerNode ChannelSplitterNode CharacterData ChildNode ChromeWorker ClipboardEvent CloseEvent Comment CompositionEvent Connection Console ContactManager ConvolverNode Coordinates CSS CSSConditionRule CSSGroupingRule CSSKeyframeRule CSSKeyframesRule CSSMediaRule CSSNamespaceRule CSSPageRule CSSRule CSSRuleList CSSStyleDeclaration CSSStyleRule CSSStyleSheet CSSSupportsRule CustomEvent - syntax keyword javaScriptWebAPI DataTransfer DataView DedicatedWorkerGlobalScope DelayNode DeviceAcceleration DeviceLightEvent DeviceMotionEvent DeviceOrientationEvent DeviceProximityEvent DeviceRotationRate DeviceStorage DeviceStorageChangeEvent DirectoryEntry DirectoryEntrySync DirectoryReader DirectoryReaderSync Document DocumentFragment DocumentTouch DocumentType DOMConfiguration DOMCursor DOMError DOMErrorHandler DOMException DOMHighResTimeStamp DOMImplementation DOMImplementationList DOMImplementationSource DOMLocator DOMObject DOMParser DOMRequest DOMString DOMStringList DOMStringMap DOMTimeStamp DOMTokenList DOMUserData DynamicsCompressorNode - syntax keyword javaScriptWebAPI Element ElementTraversal Entity EntityReference Entry EntrySync ErrorEvent Event EventListener EventSource EventTarget Extensions File FileEntry FileEntrySync FileError FileException FileList FileReader FileSystem FileSystemSync Float32Array Float64Array FMRadio FocusEvent FormData GainNode Geolocation History - syntax keyword javaScriptWebAPI HTMLAnchorElement HTMLAreaElement HTMLAudioElement HTMLBaseElement HTMLBaseFontElement HTMLBodyElement HTMLBRElement HTMLButtonElement HTMLCanvasElement HTMLCollection HTMLDataElement HTMLDataListElement HTMLDivElement HTMLDListElement HTMLDocument HTMLElement HTMLEmbedElement HTMLFieldSetElement HTMLFormControlsCollection HTMLFormElement HTMLHeadElement HTMLHeadingElement HTMLHRElement HTMLHtmlElement HTMLIFrameElement HTMLImageElement HTMLInputElement HTMLIsIndexElement HTMLKeygenElement HTMLLabelElement HTMLLegendElement HTMLLIElement HTMLLinkElement HTMLMapElement HTMLMediaElement HTMLMetaElement HTMLMeterElement HTMLModElement HTMLObjectElement HTMLOListElement HTMLOptGroupElement HTMLOptionElement HTMLOptionsCollection HTMLOutputElement HTMLParagraphElement HTMLParamElement HTMLPreElement HTMLProgressElement HTMLQuoteElement HTMLScriptElement HTMLSelectElement HTMLSourceElement HTMLSpanElement HTMLStyleElement HTMLTableCaptionElement HTMLTableCellElement HTMLTableColElement HTMLTableElement HTMLTableRowElement HTMLTableSectionElement HTMLTextAreaElement HTMLTimeElement HTMLTitleElement HTMLTrackElement HTMLUListElement HTMLUnknownElement HTMLVideoElement - syntax keyword javaScriptWebAPI IDBCursor IDBCursorWithValue IDBDatabase IDBDatabaseException IDBEnvironment IDBFactory IDBIndex IDBKeyRange IDBObjectStore IDBOpenDBRequest IDBRequest IDBTransaction IDBVersionChangeEvent ImageData Int16Array Int32Array Int8Array KeyboardEvent LinkStyle LocalFileSystem LocalFileSystemSync Location MediaQueryList MediaQueryListListener MediaSource MediaStream MediaStreamTrack MessageEvent MouseEvent MouseScrollEvent MouseWheelEvent MozActivity MozActivityOptions MozActivityRequestHandler MozAlarmsManager MozContact MozContactChangeEvent MozIccManager MozMmsEvent MozMmsMessage MozMobileCellInfo MozMobileCFInfo MozMobileConnection MozMobileConnectionInfo MozMobileICCInfo MozMobileMessageManager MozMobileMessageThread MozMobileNetworkInfo MozNetworkStats MozNetworkStatsData MozNetworkStatsManager MozSettingsEvent MozSmsEvent MozSmsFilter MozSmsManager MozSmsMessage MozSmsSegmentInfo MozTimeManager MozWifiConnectionInfoEvent MutationObserver - syntax keyword javaScriptWebAPI NamedNodeMap NameList Navigator NavigatorGeolocation NavigatorID NavigatorLanguage NavigatorOnLine NavigatorPlugins NetworkInformation Node NodeFilter NodeIterator NodeList Notation Notification NotifyAudioAvailableEvent OfflineAudioCompletionEvent OfflineAudioContext PannerNode ParentNode Performance PerformanceNavigation PerformanceTiming Plugin PluginArray Position PositionError PositionOptions PowerManager ProcessingInstruction ProgressEvent Promise PromiseResolver PushManager - syntax keyword javaScriptWebAPI Range ScriptProcessorNode Selection SettingsLock SettingsManager SharedWorker StyleSheet StyleSheetList SVGAElement SVGAngle SVGAnimateColorElement SVGAnimatedAngle SVGAnimatedBoolean SVGAnimatedEnumeration SVGAnimatedInteger SVGAnimatedLengthList SVGAnimatedNumber SVGAnimatedNumberList SVGAnimatedPoints SVGAnimatedPreserveAspectRatio SVGAnimatedRect SVGAnimatedString SVGAnimatedTransformList SVGAnimateElement SVGAnimateMotionElement SVGAnimateTransformElement SVGAnimationElement SVGCircleElement SVGClipPathElement SVGCursorElement SVGDefsElement SVGDescElement SVGElement SVGEllipseElement SVGFilterElement SVGFontElement SVGFontFaceElement SVGFontFaceFormatElement SVGFontFaceNameElement SVGFontFaceSrcElement SVGFontFaceUriElement - syntax keyword javaScriptWebAPI SVGForeignObjectElement SVGGElement SVGGlyphElement SVGGradientElement SVGHKernElement SVGImageElement SVGLength SVGLengthList SVGLinearGradientElement SVGLineElement SVGMaskElement SVGMatrix SVGMissingGlyphElement SVGMPathElement SVGNumber SVGNumberList SVGPathElement SVGPatternElement SVGPolygonElement SVGPolylineElement SVGPreserveAspectRatio SVGRadialGradientElement SVGRect SVGRectElement SVGScriptElement SVGSetElement SVGStopElement SVGStringList SVGStylable SVGStyleElement SVGSVGElement SVGSwitchElement SVGSymbolElement SVGTests SVGTextElement SVGTextPositioningElement SVGTitleElement SVGTransform SVGTransformable SVGTransformList SVGTRefElement SVGTSpanElement SVGUseElement SVGViewElement SVGVKernElement TCPSocket Telephony TelephonyCall Text TextDecoder TextEncoder TextMetrics TimeRanges Touch TouchEvent TouchList Transferable TransitionEvent TreeWalker TypeInfo UIEvent Uint16Array Uint32Array Uint8Array Uint8ClampedArray URL URLUtils URLUtilsReadOnly - " }}} - " DOM2 CONSTANT {{{ - syntax keyword javaScriptDomErrNo INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR - syntax keyword javaScriptDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE - "}}} - " HTML events and internal variables"{{{ - syntax case ignore - syntax keyword javaScriptHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize onload onsubmit - syntax case match - "}}} +syn keyword javaScriptConditional if else switch +syn keyword javaScriptRepeat while for do in +syn keyword javaScriptBranch break continue +syn keyword javaScriptOperator new delete instanceof typeof +syn keyword javaScriptType Array Boolean Date Function Number Object String RegExp +syn keyword javaScriptStatement return with await +syn keyword javaScriptBoolean true false +syn keyword javaScriptNull null undefined +syn keyword javaScriptIdentifier arguments this var let +syn keyword javaScriptLabel case default +syn keyword javaScriptException try catch finally throw +syn keyword javaScriptMessage alert confirm prompt status +syn keyword javaScriptGlobal self window top parent +syn keyword javaScriptMember document event location +syn keyword javaScriptDeprecated escape unescape +syn keyword javaScriptReserved abstract boolean byte char class const debugger double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile async - " Follow stuff should be highligh within a special context - " While it can't be handled with context depended with Regex based highlight - " So, turn it off by default - if exists("javascript_enable_domhtmlcss") - " DOM2 things {{{ - syntax match javaScriptDomElemAttrs contained /\%(nodeName\|nodeValue\|nodeType\|parentNode\|childNodes\|firstChild\|lastChild\|previousSibling\|nextSibling\|attributes\|ownerDocument\|namespaceURI\|prefix\|localName\|tagName\)\>/ - syntax match javaScriptDomElemFuncs contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=javaScriptParen skipwhite - "}}} - " HTML things {{{ - syntax match javaScriptHtmlElemAttrs contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/ - syntax match javaScriptHtmlElemFuncs contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=javaScriptParen skipwhite - "}}} - " CSS Styles in JavaScript {{{ - syntax keyword javaScriptCssStyles contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition - syntax keyword javaScriptCssStyles contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition - syntax keyword javaScriptCssStyles contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode - syntax keyword javaScriptCssStyles contained bottom height left position right top width zIndex - syntax keyword javaScriptCssStyles contained border borderBottom borderLeft borderRight borderTop borderBottomColor borderLeftColor borderTopColor borderBottomStyle borderLeftStyle borderRightStyle borderTopStyle borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderColor borderStyle borderWidth borderCollapse borderSpacing captionSide emptyCells tableLayout - syntax keyword javaScriptCssStyles contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop - syntax keyword javaScriptCssStyles contained listStyle listStyleImage listStylePosition listStyleType - syntax keyword javaScriptCssStyles contained background backgroundAttachment backgroundColor backgroundImage gackgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat - syntax keyword javaScriptCssStyles contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType - syntax keyword javaScriptCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText - syntax keyword javaScriptCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor - "}}} - " Highlight ways {{{ - syntax match javaScriptDotNotation "\." nextgroup=javaScriptPrototype,javaScriptDomElemAttrs,javaScriptDomElemFuncs,javaScriptHtmlElemAttrs,javaScriptHtmlElemFuncs - syntax match javaScriptDotNotation "\.style\." nextgroup=javaScriptCssStyles - "}}} - endif -" end DOM/HTML/CSS specified things }}} -" Code blocks"{{{ -syntax cluster javaScriptAll contains=javaScriptComment,javaScriptLineComment,javaScriptDocComment,javaScriptString,javaScriptRegexpString,javaScriptNumber,javaScriptFloat,javaScriptLabel,javaScriptSource,javaScriptWebAPI,javaScriptOperator,javaScriptBoolean,javaScriptNull,javaScriptFuncKeyword,javaScriptConditional,javaScriptGlobal,javaScriptRepeat,javaScriptBranch,javaScriptStatement,javaScriptGlobalObjects,javaScriptMessage,javaScriptIdentifier,javaScriptExceptions,javaScriptReserved,javaScriptDeprecated,javaScriptDomErrNo,javaScriptDomNodeConsts,javaScriptHtmlEvents,javaScriptDotNotation,javaScriptBrowserObjects,javaScriptDOMObjects,javaScriptAjaxObjects,javaScriptPropietaryObjects,javaScriptDOMMethods,javaScriptHtmlElemProperties,javaScriptDOMProperties,javaScriptEventListenerKeywords,javaScriptEventListenerMethods,javaScriptAjaxProperties,javaScriptAjaxMethods,javaScriptFuncArg +syn cluster javaScriptEmbededExpr contains=javaScriptBoolean,javaScriptNull,javaScriptIdentifier,javaScriptStringD,javaScriptStringS,javaScriptStringT + +if exists("javaScript_fold") + syn match javaScriptFunction "\<function\>" + syn region javaScriptFunctionFold start="\<function\>.*[^};]$" end="^\z1}.*$" transparent fold keepend + + syn sync match javaScriptSync grouphere javaScriptFunctionFold "\<function\>" + syn sync match javaScriptSync grouphere NONE "^}" + + setlocal foldmethod=syntax + setlocal foldtext=getline(v:foldstart) +else + syn keyword javaScriptFunction function + syn match javaScriptBraces "[{}\[\]]" + syn match javaScriptParens "[()]" +endif + +syn sync fromstart +syn sync maxlines=100 if main_syntax == "javascript" - syntax sync clear - syntax sync ccomment javaScriptComment minlines=200 - " syntax sync match javaScriptHighlight grouphere javaScriptBlock /{/ + syn sync ccomment javaScriptComment endif -"}}} -" Function and arguments highlighting {{{ -syntax keyword javaScriptFuncKeyword function contained -syntax region javaScriptFuncExp start=/\w\+\s\==\s\=function\>/ end="\([^)]*\)" contains=javaScriptFuncEq,javaScriptFuncKeyword,javaScriptFuncArg keepend -syntax match javaScriptFuncArg "\(([^()]*)\)" contains=javaScriptParens,javaScriptFuncComma,javaScriptComment contained -syntax match javaScriptFuncComma /,/ contained -syntax match javaScriptFuncEq /=/ contained -syntax region javaScriptFuncDef start="\<function\>" end="\([^)]*\)" contains=javaScriptFuncKeyword,javaScriptFuncArg keepend -syntax match javaScriptObjectKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=javaScriptFunctionKey -syntax match javaScriptFunctionKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/ contained -"}}} -" Braces, Parens, symbols, colons {{{ -syntax match javaScriptBraces "[{}\[\]]" -syntax match javaScriptParens "[()]" -syntax match javaScriptOpSymbols "=\{1,3}\|!==\|!=\|<\|>\|>=\|<=\|++\|+=\|--\|-=" -syntax match javaScriptEndColons "[;,]" -syntax match javaScriptLogicSymbols "\(&&\)\|\(||\)" -"}}} -" ES6 String Interpolation {{{ -syntax match javaScriptTemplateDelim "\${\|}" contained -syntax region javaScriptTemplateVar start=+${+ end=+}+ contains=javaScriptTemplateDelim keepend -syntax region javaScriptTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=javaScriptTemplateVar,javaScriptSpecial keepend -"}}} -" JavaScriptFold Function {{{ - -function! JavaScriptFold() - setl foldmethod=syntax - setl foldlevelstart=1 - syntax region foldBraces start=/{/ end=/}/ transparent fold keepend extend -endfunction - -" }}} -" Highlight links {{{ -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_javascript_syn_inits") - if version < 508 - let did_javascript_syn_inits = 1 - command -nargs=+ HiLink hi link <args> - else - command -nargs=+ HiLink hi def link <args> - endif - HiLink javaScriptEndColons Operator - HiLink javaScriptOpSymbols Operator - HiLink javaScriptLogicSymbols Boolean - HiLink javaScriptBraces Function - HiLink javaScriptParens Operator - HiLink javaScriptTemplateDelim Operator - - HiLink javaScriptComment Comment - HiLink javaScriptLineComment Comment - HiLink javaScriptDocComment Comment - HiLink javaScriptCommentTodo Todo - - HiLink javaScriptDocTags Special - HiLink javaScriptDocSeeTag Function - HiLink javaScriptDocParam Function - - HiLink javaScriptString String - HiLink javaScriptRegexpString String - HiLink javaScriptTemplateString String - - HiLink javaScriptNumber Number - HiLink javaScriptFloat Number - HiLink javaScriptGlobal Constant - HiLink javaScriptCharacter Character - HiLink javaScriptPrototype Type - HiLink javaScriptConditional Conditional - HiLink javaScriptBranch Conditional - HiLink javaScriptIdentifier Identifier - HiLink javaScriptRepeat Repeat - HiLink javaScriptStatement Statement - HiLink javaScriptMessage Keyword - HiLink javaScriptReserved Keyword - HiLink javaScriptOperator Operator - HiLink javaScriptNull Type - HiLink javaScriptBoolean Boolean - HiLink javaScriptLabel Label - HiLink javaScriptSpecial Special - HiLink javaScriptSource Special - HiLink javaScriptGlobalObjects Special - HiLink javaScriptExceptions Special - - HiLink javaScriptDeprecated Exception - HiLink javaScriptError Error - HiLink javaScriptParensError Error - HiLink javaScriptParensErrA Error - HiLink javaScriptParensErrB Error - HiLink javaScriptParensErrC Error - HiLink javaScriptDomErrNo Error - - HiLink javaScriptDomNodeConsts Constant - HiLink javaScriptDomElemAttrs Label - HiLink javaScriptDomElemFuncs Type - - HiLink javaScriptWebAPI Type - - HiLink javaScriptHtmlElemAttrs Label - HiLink javaScriptHtmlElemFuncs Type +" Define the default highlighting. +" Only when an item doesn't have highlighting yet +hi def link javaScriptComment Comment +hi def link javaScriptLineComment Comment +hi def link javaScriptCommentTodo Todo +hi def link javaScriptSpecial Special +hi def link javaScriptStringS String +hi def link javaScriptStringD String +hi def link javaScriptStringT String +hi def link javaScriptCharacter Character +hi def link javaScriptSpecialCharacter javaScriptSpecial +hi def link javaScriptNumber javaScriptValue +hi def link javaScriptConditional Conditional +hi def link javaScriptRepeat Repeat +hi def link javaScriptBranch Conditional +hi def link javaScriptOperator Operator +hi def link javaScriptType Type +hi def link javaScriptStatement Statement +hi def link javaScriptFunction Function +hi def link javaScriptBraces Function +hi def link javaScriptError Error +hi def link javaScrParenError javaScriptError +hi def link javaScriptNull Keyword +hi def link javaScriptBoolean Boolean +hi def link javaScriptRegexpString String - HiLink javaScriptCssStyles Type - - HiLink javaScriptBrowserObjects Constant - - HiLink javaScriptDOMObjects Constant - HiLink javaScriptDOMMethods Type - HiLink javaScriptDOMProperties Label - - HiLink javaScriptAjaxObjects Constant - HiLink javaScriptAjaxMethods Type - HiLink javaScriptAjaxProperties Label +hi def link javaScriptIdentifier Identifier +hi def link javaScriptLabel Label +hi def link javaScriptException Exception +hi def link javaScriptMessage Keyword +hi def link javaScriptGlobal Keyword +hi def link javaScriptMember Keyword +hi def link javaScriptDeprecated Exception +hi def link javaScriptReserved Keyword +hi def link javaScriptDebug Debug +hi def link javaScriptConstant Label +hi def link javaScriptEmbed Special - HiLink javaScriptFuncKeyword Function - HiLink javaScriptFuncDef PreProc - HiLink javaScriptFuncExp Title - HiLink javaScriptFuncArg Special - HiLink javaScriptFuncComma Operator - HiLink javaScriptFuncEq Operator - HiLink javaScriptHtmlEvents Constant - HiLink javaScriptHtmlElemProperties Label - - HiLink javaScriptEventListenerKeywords Type - - HiLink javaScriptPropietaryObjects Constant - - delcommand HiLink -endif -" end Highlight links }}} - -" Define the htmlJavaScript for HTML syntax html.vim -"syntax clear htmlJavaScript -"syntax clear javaScriptExpression -syntax cluster htmlJavaScript contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError -syntax cluster javaScriptExpression contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError,@htmlPreproc let b:current_syntax = "javascript" if main_syntax == 'javascript' - unlet main_syntax + unlet main_syntax endif -syntax region jsInJsdocExample matchgroup=Snip start="^\s*\* @example" end="\(^\s*\* [^[:space:]]\)\@=" containedin=@javaScriptComment contains=@javaScriptAll -hi link Snip SpecialComment +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: ts=8
--- a/vendor/vim-syntax/json.vim Mon Jan 13 00:19:42 2020 +0900 +++ b/vendor/vim-syntax/json.vim Tue Jan 14 11:09:50 2020 +0900 @@ -1,7 +1,8 @@ " Vim syntax file " Language: JSON -" Maintainer: Eli Parra <eli@elzr.com> -" Last Change: 2014 Aug 23 +" Maintainer: vacancy +" Previous Maintainer: Eli Parra <eli@elzr.com> +" Last Change: 2019 Sep 17 " Version: 0.12 if !exists("main_syntax") @@ -16,10 +17,21 @@ " NOTE that for the concealing to work your conceallevel should be set to 2 +" Syntax: JSON Keywords +" Separated into a match and region because a region by itself is always greedy +syn match jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword +if has('conceal') && (!exists("g:vim_json_conceal") || g:vim_json_conceal==1) + syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ concealends contained +else + syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ contained +endif + " Syntax: Strings " Separated into a match and region because a region by itself is always greedy +" Needs to come after keywords or else a json encoded string will break the +" syntax syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString -if has('conceal') +if has('conceal') && (!exists("g:vim_json_conceal") || g:vim_json_conceal==1) syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ concealends contains=jsonEscape contained else syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=jsonEscape contained @@ -28,14 +40,6 @@ " Syntax: JSON does not allow strings with single quotes, unlike JavaScript. syn region jsonStringSQError oneline start=+'+ skip=+\\\\\|\\"+ end=+'+ -" Syntax: JSON Keywords -" Separated into a match and region because a region by itself is always greedy -syn match jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword -if has('conceal') - syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ concealends contained -else - syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ contained -endif " Syntax: Escape sequences syn match jsonEscape "\\["\\/bfnrt]" contained
--- a/vendor/vim-syntax/nginx.vim Mon Jan 13 00:19:42 2020 +0900 +++ b/vendor/vim-syntax/nginx.vim Tue Jan 14 11:09:50 2020 +0900 @@ -333,6 +333,7 @@ syn keyword ngxDirective contained js_content syn keyword ngxDirective contained js_filter syn keyword ngxDirective contained js_include +syn keyword ngxDirective contained js_path syn keyword ngxDirective contained js_preread syn keyword ngxDirective contained js_set syn keyword ngxDirective contained keepalive @@ -353,6 +354,7 @@ syn keyword ngxDirective contained limit_rate syn keyword ngxDirective contained limit_rate_after syn keyword ngxDirective contained limit_req +syn keyword ngxDirective contained limit_req_dry_run syn keyword ngxDirective contained limit_req_log_level syn keyword ngxDirective contained limit_req_status syn keyword ngxDirective contained limit_req_zone @@ -472,6 +474,7 @@ syn keyword ngxDirective contained proxy_responses syn keyword ngxDirective contained proxy_send_lowat syn keyword ngxDirective contained proxy_send_timeout +syn keyword ngxDirective contained proxy_session_drop syn keyword ngxDirective contained proxy_set_body syn keyword ngxDirective contained proxy_set_header syn keyword ngxDirective contained proxy_socket_keepalive @@ -1325,6 +1328,7 @@ syn keyword ngxDirectiveThirdParty contained lua_code_cache syn keyword ngxDirectiveThirdParty contained lua_fake_shm syn keyword ngxDirectiveThirdParty contained lua_http10_buffering +syn keyword ngxDirectiveThirdParty contained lua_load_resty_core syn keyword ngxDirectiveThirdParty contained lua_malloc_trim syn keyword ngxDirectiveThirdParty contained lua_max_pending_timers syn keyword ngxDirectiveThirdParty contained lua_max_running_timers @@ -1779,6 +1783,7 @@ syn keyword ngxDirectiveThirdParty contained vod_fallback_upstream_location syn keyword ngxDirectiveThirdParty contained vod_force_continuous_timestamps syn keyword ngxDirectiveThirdParty contained vod_force_playlist_type_vod +syn keyword ngxDirectiveThirdParty contained vod_force_sequence_index syn keyword ngxDirectiveThirdParty contained vod_gop_look_ahead syn keyword ngxDirectiveThirdParty contained vod_gop_look_behind syn keyword ngxDirectiveThirdParty contained vod_ignore_edit_list
--- a/vendor/vim-syntax/ruby.vim Mon Jan 13 00:19:42 2020 +0900 +++ b/vendor/vim-syntax/ruby.vim Tue Jan 14 11:09:50 2020 +0900 @@ -3,7 +3,7 @@ " Maintainer: Doug Kearns <dougkearns@gmail.com> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2018 Jul 09 +" Last Change: 2019 Jul 13 " ---------------------------------------------------------------------------- " " Previous Maintainer: Mirko Nasato @@ -19,6 +19,11 @@ let s:cpo_sav = &cpo set cpo&vim +" eRuby Config {{{1 +if exists('main_syntax') && main_syntax == 'eruby' + let b:ruby_no_expensive = 1 +endif + " Folding Config {{{1 if has("folding") && exists("ruby_fold") setlocal foldmethod=syntax @@ -33,6 +38,10 @@ \ ) function! s:foldable(...) abort + if index(s:foldable_groups, 'NONE') > -1 + return 0 + endif + if index(s:foldable_groups, 'ALL') > -1 return 1 endif @@ -44,9 +53,20 @@ endfor return 0 -endfunction " }}} +endfunction -syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo,rubyModuleName,rubyClassName,rubySymbolDelimiter +function! s:run_syntax_fold(args) abort + let [_0, _1, groups, cmd; _] = matchlist(a:args, '\(["'']\)\(.\{-}\)\1\s\+\(.*\)') + if call('s:foldable', split(groups)) + let cmd .= ' fold' + endif + exe cmd +endfunction + +com! -nargs=* SynFold call s:run_syntax_fold(<q-args>) + +" Not-Top Cluster {{{1 +syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,@rubyClassOperator,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyParentheses " Whitespace Errors {{{1 if exists("ruby_space_errors") @@ -59,427 +79,400 @@ endif " Operators {{{1 -if exists("ruby_operators") - syn match rubyOperator "[~!^|*/%+-]\|&\.\@!\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@1<!>\|\*\*\|\.\.\.\|\.\.\|::" - syn match rubyOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=" - syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@2<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop + +syn match rubyEnglishBooleanOperator "\<\%(and\|or\|not\)\>" + +if exists("ruby_operators") || exists("ruby_pseudo_operators") + syn match rubyDotOperator "\.\|&\." + + syn match rubyTernaryOperator "\%(\w\|[^\x00-\x7F]\)\@1<!?\|:" + syn match rubyArithmeticOperator "\*\*\|[*/%+]\|->\@!" + syn match rubyComparisonOperator "<=>\|<=\|<\|>=\|[-=]\@1<!>" + syn match rubyBitwiseOperator "[~^|]\|&\.\@!\|<<\|>>" + syn match rubyBooleanOperator "\%(\w\|[^\x00-\x7F]\)\@1<!!\|&&\|||" + syn match rubyRangeOperator "\.\.\.\=" + syn match rubyAssignmentOperator "=>\@!\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|||=\||=\|%=\|+=\|>>=\|<<=\|\^=" + syn match rubyAssignmentOperator "=>\@!" containedin=rubyBlockParameterList " TODO: this is inelegant + syn match rubyEqualityOperator "===\|==\|!=\|!\~\|=\~" + + syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\%(\w\|[^\x00-\x7F]\)[?!]\=\|[]})]\)\@2<=\[" end="]" contains=ALLBUT,@rubyNotTop + + syn match rubyScopeOperator "::" + syn match rubySuperClassOperator "<" contained + syn match rubyEigenClassOperator "<<" contained + syn match rubyLambdaOperator "->" + syn match rubySplatOperator "\%([[{(|,=]\_s*\)\@<=\*" + syn match rubySplatOperator "\%(^\|\s\)\@1<=\*\%(\h\|[^\x00-\x7F]\|[:$@[]\)\@=" + syn match rubyDoubleSplatOperator "\%([{(|,]\_s*\)\@<=\*\*" + syn match rubyDoubleSplatOperator "\s\@1<=\*\*\%(\h\|[^\x00-\x7F]\|[:$@{]\)\@=" + syn match rubyProcOperator "\%([[(|,]\_s*\)\@<=&" + syn match rubyProcOperator "\s\@1<=&\%(\h\|[^\x00-\x7F]\|[:$@]\|->\)\@=" + + syn cluster rubyProperOperator contains=rubyTernaryOperator,rubyArithmeticOperator,rubyComparisonOperator,rubyBitwiseOperator,rubyBooleanOperator,rubyRangeOperator,rubyAssignmentOperator,rubyEqualityOperator,rubyDefinedOperator,rubyEnglishBooleanOperator + syn cluster rubyClassOperator contains=rubyEigenClassOperator,rubySuperClassOperator + syn cluster rubyPseudoOperator contains=rubyDotOperator,rubyScopeOperator,rubyEigenClassOperator,rubySuperClassOperator,rubyLambdaOperator,rubySplatOperator,rubyDoubleSplatOperator,rubyProcOperator + syn cluster rubyOperator contains=ruby.*Operator endif -" Expression Substitution and Backslash Notation {{{1 -syn match rubyStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display -syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display -syn match rubyQuoteEscape "\\[\\']" contained display - +" String Interpolation and Backslash Notation {{{1 syn region rubyInterpolation matchgroup=rubyInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,@rubyNotTop -syn match rubyInterpolation "#\%(\$\|@@\=\)\w\+" display contained contains=rubyInterpolationDelimiter,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable,rubyPredefinedVariable -syn match rubyInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained -syn match rubyInterpolation "#\$\%(-\w\|\W\)" display contained contains=rubyInterpolationDelimiter,rubyPredefinedVariable,rubyInvalidVariable -syn match rubyInterpolationDelimiter "#\ze\$\%(-\w\|\W\)" display contained -syn region rubyNoInterpolation start="\\#{" end="}" contained -syn match rubyNoInterpolation "\\#{" display contained -syn match rubyNoInterpolation "\\#\%(\$\|@@\=\)\w\+" display contained -syn match rubyNoInterpolation "\\#\$\W" display contained +syn match rubyInterpolation "#\$\%(-\w\|[!$&"'*+,./0:;<>?@\`~_]\|\w\+\)" display contained contains=rubyInterpolationDelimiter,@rubyGlobalVariable +syn match rubyInterpolation "#@@\=\w\+" display contained contains=rubyInterpolationDelimiter,rubyInstanceVariable,rubyClassVariable +syn match rubyInterpolationDelimiter "#\ze[$@]" display contained + +syn match rubyStringEscape "\\\_." contained display +syn match rubyStringEscape "\\\o\{1,3}\|\\x\x\{1,2}" contained display +syn match rubyStringEscape "\\u\%(\x\{4}\|{\x\{1,6}\%(\s\+\x\{1,6}\)*}\)" contained display +syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=.\)" contained display -syn match rubyDelimiterEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE +syn match rubyBackslashEscape "\\\\" contained display +syn match rubyQuoteEscape "\\'" contained display +syn match rubySpaceEscape "\\ " contained display + +syn match rubyParenthesisEscape "\\[()]" contained display +syn match rubyCurlyBraceEscape "\\[{}]" contained display +syn match rubyAngleBracketEscape "\\[<>]" contained display +syn match rubySquareBracketEscape "\\[[\]]" contained display syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained +syn cluster rubySingleCharEscape contains=rubyBackslashEscape,rubyQuoteEscape,rubySpaceEscape,rubyParenthesisEscape,rubyCurlyBraceEscape,rubyAngleBracketEscape,rubySquareBracketEscape +syn cluster rubyNestedBrackets contains=rubyNested.\+ +syn cluster rubyStringSpecial contains=rubyInterpolation,rubyStringEscape +syn cluster rubyStringNotTop contains=@rubyStringSpecial,@rubyNestedBrackets,@rubySingleCharEscape + " Regular Expression Metacharacters {{{1 -" These are mostly Oniguruma ready -syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\)" end=")" contained -syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\)" end=")" contained transparent contains=@rubyRegexpSpecial -syn region rubyRegexpBrackets matchgroup=rubyRegexpCharClass start="\[\^\=" skip="\\\]" end="\]" contained transparent contains=rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass oneline -syn match rubyRegexpCharClass "\\[DdHhSsWw]" contained display -syn match rubyRegexpCharClass "\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\):\]" contained -syn match rubyRegexpEscape "\\[].*?+^$|\\/(){}[]" contained -syn match rubyRegexpQuantifier "[*?+][?+]\=" contained display -syn match rubyRegexpQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display -syn match rubyRegexpAnchor "[$^]\|\\[ABbGZz]" contained display -syn match rubyRegexpDot "\." contained display -syn match rubyRegexpSpecial "|" contained display -syn match rubyRegexpSpecial "\\[1-9]\d\=\d\@!" contained display -syn match rubyRegexpSpecial "\\k<\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\=>" contained display -syn match rubyRegexpSpecial "\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" contained display -syn match rubyRegexpSpecial "\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display -syn match rubyRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display +syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\\\\|\\)" end=")" contained +syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\\\\|\\)" end=")" contained transparent contains=@rubyRegexpSpecial +syn region rubyRegexpBrackets matchgroup=rubyRegexpCharClass start="\[\^\=" skip="\\\\\|\\\]" end="\]" contained transparent contains=rubyRegexpBrackets,rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass,rubyRegexpIntersection oneline +syn match rubyRegexpCharClass "\\[DdHhRSsWw]" contained display +syn match rubyRegexpCharClass "\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]" contained +syn match rubyRegexpCharClass "\\[pP]{^\=.\{-}}" contained display +syn match rubyRegexpEscape "\\[].*?+^$|\\/(){}[]" contained " see commit e477f10 +syn match rubyRegexpQuantifier "[*?+][?+]\=" contained display +syn match rubyRegexpQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display +syn match rubyRegexpAnchor "[$^]\|\\[ABbGZz]" contained display +syn match rubyRegexpDot "\.\|\\X" contained display +syn match rubyRegexpIntersection "&&" contained display +syn match rubyRegexpSpecial "\\K" contained display +syn match rubyRegexpSpecial "|" contained display +syn match rubyRegexpSpecial "\\[1-9]\d\=\d\@!" contained display +syn match rubyRegexpSpecial "\\k<\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\=>" contained display +syn match rubyRegexpSpecial "\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" contained display +syn match rubyRegexpSpecial "\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display +syn match rubyRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display -syn cluster rubyStringSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape -syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets -syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment +syn cluster rubyRegexpSpecial contains=@rubyStringSpecial,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment,rubyRegexpIntersection -" Numbers and ASCII Codes {{{1 -syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@1<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)" -syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*r\=i\=\>" display -syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)r\=i\=\>" display -syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*r\=i\=\>" display -syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)*r\=i\=\>" display -syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*r\=i\=\>" display -syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)r\=i\=\>" display +" Numbers {{{1 +syn match rubyInteger "\%(\%(\w\|[^\x00-\x7F]\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*r\=i\=\>" display +syn match rubyInteger "\%(\%(\w\|[^\x00-\x7F]\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)r\=i\=\>" display +syn match rubyInteger "\%(\%(\w\|[^\x00-\x7F]\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*r\=i\=\>" display +syn match rubyInteger "\%(\%(\w\|[^\x00-\x7F]\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)*r\=i\=\>" display +syn match rubyFloat "\%(\%(\w\|[^\x00-\x7F]\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*r\=i\=\>" display +syn match rubyFloat "\%(\%(\w\|[^\x00-\x7F]\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)i\=\>" display " Identifiers {{{1 -syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent -syn match rubyBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent - -syn match rubyClassName "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" contained -syn match rubyModuleName "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" contained -syn match rubyConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" -syn match rubyClassVariable "@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display -syn match rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display -syn match rubyGlobalVariable "$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)" -syn match rubySymbolDelimiter ":" contained -syn match rubySymbol "[]})\"':]\@1<!:\%(\^\|\~@\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!@\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" contains=rubySymbolDelimiter -syn match rubySymbol "[]})\"':]\@1<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)" contains=rubySymbolDelimiter -syn match rubySymbol "[]})\"':]\@1<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contains=rubySymbolDelimiter -syn match rubySymbol "[]})\"':]\@1<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\=" contains=rubySymbolDelimiter - -if s:foldable(':') - syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold - syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold -else - syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial -endif - -syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)*\s*(\@=" - -syn match rubyBlockParameter "\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contained -syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\_s*\)\@32<=|" end="|" oneline display contains=rubyBlockParameter - -syn match rubyInvalidVariable "$[^ A-Za-z_-]" -syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~]# -syn match rubyPredefinedVariable "$\d\+" display -syn match rubyPredefinedVariable "$_\>" display -syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display -syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display -syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display -syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(ARGF\|ARGV\|ENV\|DATA\|FALSE\|NIL\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>\%(\s*(\)\@!" -syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(RUBY_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!" +syn match rubyClassName "\%(\%(^\|[^.]\)\.\s*\)\@<!\<[[:upper:]]\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" contained +syn match rubyModuleName "\%(\%(^\|[^.]\)\.\s*\)\@<!\<[[:upper:]]\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" contained +syn match rubyConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<[[:upper:]]\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" +syn match rubyClassVariable "@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display +syn match rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display +syn match rubyGlobalVariable "$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)" +syn match rubySymbolDelimiter ":" contained +syn match rubySymbol "[]})\"':]\@1<!:\%(\^\|\~@\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!@\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" contains=rubySymbolDelimiter +syn match rubySymbol "[]})\"':]\@1<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)" contains=rubySymbolDelimiter +syn match rubySymbol "[]})\"':]\@1<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contains=rubySymbolDelimiter +syn match rubySymbol "[]})\"':]\@1<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\=" contains=rubySymbolDelimiter -" Normal Regular Expression {{{1 -if s:foldable('/') - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/\%([ \t=]\|$\)\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold -else - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/\%([ \t=]\|$\)\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial -endif +SynFold ':' syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,rubyBackslashEscape +SynFold ':' syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial + +syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@=" -" Generalized Regular Expression {{{1 -if s:foldable('%') - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape fold - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z(\s\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold -else - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z(\s\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial -endif +syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop containedin=rubyBlockParameterList +syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\_s*\)\@32<=|" end="|" contains=ALLBUT,@rubyNotTop,@rubyProperOperator -" Normal String {{{1 -let s:spell_cluster = exists('ruby_spellcheck_strings') ? ',@Spell' : '' -exe 'syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" ' . - \ (s:foldable('%') ? 'fold' : '') . ' contains=@rubyStringSpecial' . s:spell_cluster -exe 'syn region rubyString matchgroup=rubyStringDelimiter start="''" end="''" skip="\\\\\|\\''" ' . - \ (s:foldable('%') ? 'fold' : '') . ' contains=rubyQuoteEscape' . s:spell_cluster - -" Shell Command Output {{{1 -if s:foldable('%') - syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold -else - syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial +if exists('ruby_global_variable_error') + syn match rubyGlobalVariableError "$[^A-Za-z_]" display + syn match rubyGlobalVariableError "$-[^0FIKWadilpvw]" display endif -" Generalized Single Quoted String, Symbol and Array of Strings {{{1 -if s:foldable('%') - syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold - syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%q\z(\s\)" end="\z1" skip="\\\\\|\\\z1" fold - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%s\z(\s\)" end="\z1" skip="\\\\\|\\\z1" fold -else - syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" - syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" contains=rubyNestedCurlyBraces,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" contains=rubyNestedAngleBrackets,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" contains=rubyNestedSquareBrackets,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" contains=rubyNestedParentheses,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%q\z(\s\)" end="\z1" skip="\\\\\|\\\z1" - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" contains=rubyNestedCurlyBraces,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" contains=rubyNestedAngleBrackets,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" contains=rubyNestedSquareBrackets,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" contains=rubyNestedParentheses,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%s\z(\s\)" end="\z1" skip="\\\\\|\\\z1" -endif +syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<>?@\`~]# +syn match rubyPredefinedVariable "$\d\+" display +syn match rubyPredefinedVariable "$_\>" display +syn match rubyPredefinedVariable "$-[0FIWadilpvw]\>" display +syn match rubyPredefinedVariable "$\%(stderr\|stdin\|stdout\)\>" display +syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display +syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(ARGF\|ARGV\|ENV\|DATA\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\)\>\%(\s*(\)\@!" +syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(RUBY_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!" + +" Deprecated/removed in 1.9 +syn match rubyPredefinedVariable "$=" +syn match rubyPredefinedVariable "$-K\>" display +syn match rubyPredefinedVariable "$\%(deferr\|defout\)\>" display +syn match rubyPredefinedVariable "$KCODE\>" display +" Deprecated/removed in 2.4 +syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(FALSE\|NIL\|TRUE\)\>\%(\s*(\)\@!" + +syn cluster rubyGlobalVariable contains=rubyGlobalVariable,rubyPredefinedVariable,rubyGlobalVariableError + +" Normal Regular Expressions {{{1 +SynFold '/' syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial nextgroup=@rubyModifier skipwhite +SynFold '/' syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\s\+\)\@<=/\%(=\|\_s\)\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial nextgroup=@rubyModifier skipwhite -" Generalized Double Quoted String and Array of Strings and Shell Command Output {{{1 -" Note: %= is not matched here as the beginning of a double quoted string -if s:foldable('%') - syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold - syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold - syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape fold - syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape fold - syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape fold - syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape fold - syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx]\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold -else - syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial - syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial - syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape - syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx]\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial -endif +" Generalized Regular Expressions {{{1 +SynFold '%' syn region rubyRegexp matchgroup=rubyPercentRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial nextgroup=@rubyModifier skipwhite +SynFold '%' syn region rubyRegexp matchgroup=rubyPercentRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial +SynFold '%' syn region rubyRegexp matchgroup=rubyPercentRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets +SynFold '%' syn region rubyRegexp matchgroup=rubyPercentRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial +SynFold '%' syn region rubyRegexp matchgroup=rubyPercentRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial +SynFold '%' syn region rubyRegexp matchgroup=rubyPercentRegexpDelimiter start="%r\z(\s\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial + +" Characters {{{1 +syn match rubyCharacter "\%(\w\|[^\x00-\x7F]\|[]})\"'/]\)\@1<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\[[:space:]]\|\\\=[^[:space:]]\)\)" +syn match rubyCharacter "\%(\w\|[^\x00-\x7F]\|[]})\"'/]\)\@1<!?\\u\%(\x\{4}\|{\x\{1,6}}\)" + +" Normal Strings {{{1 +let s:spell_cluster = exists('ruby_spellcheck_strings') ? ',@Spell' : '' +let s:fold_arg = s:foldable('string') ? ' fold' : '' +exe 'syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial' . s:spell_cluster . s:fold_arg +exe 'syn region rubyString matchgroup=rubyStringDelimiter start="''" end="''" skip="\\\\\|\\''" contains=rubyQuoteEscape,rubyBackslashEscape' . s:spell_cluster . s:fold_arg +unlet s:spell_cluster s:fold_arg + +" Shell Command Output {{{1 +SynFold 'string' syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial + +" Generalized Single Quoted Strings, Symbols, Array of Strings and Array of Symbols {{{1 + +" Non-bracket punctuation delimiters {{{2 +let s:names = { '~': 'Tilde', '`': 'BackQuote', '!': 'Bang', '@': 'At', '#': 'Hash', '$': 'Dollar', '%': 'Percent', '^': 'Caret', + \ '&': 'Ampersand', '*': 'Asterix', '_': 'Underscore', '-': 'Dash', '+': 'Plus', '=': 'Equals', '|': 'Bar', + \ '\': 'Backslash', ':': 'Colon', ';': 'Semicolon', '"': 'DoubleQuote', "'": 'Quote', ',': 'Comma', '.': 'Period', + \ '?': 'QuestionMark', '/': 'ForwardSlash' } + +for s:delimiter in keys(s:names) + let s:group = 'ruby' . s:names[s:delimiter] . 'Escape' + + if s:delimiter =~ '[\"]' + let s:delimiter = '\' . s:delimiter + endif -" Array of Symbols {{{1 -if s:foldable('%') - " Array of Symbols - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimiterEscape + exe 'syn match ' . s:group . ' "\V\\' . s:delimiter . '" contained display' + exe 'syn cluster rubySingleCharEscape add=' . s:group + exe 'SynFold ''%'' syn region rubyString matchgroup=rubyPercentStringDelimiter start="\V%q' . s:delimiter . '" end="\V' . s:delimiter . '" skip="\V\\\\\|\\' . s:delimiter . '" contains=rubyBackslashEscape,' . s:group . ' nextgroup=@rubyModifier skipwhite' + exe 'SynFold ''%'' syn region rubyString matchgroup=rubyPercentStringDelimiter start="\V%w' . s:delimiter . '" end="\V' . s:delimiter . '" skip="\V\\\\\|\\' . s:delimiter . '" contains=rubyBackslashEscape,rubySpaceEscape,' . s:group . ' nextgroup=@rubyModifier skipwhite' + exe 'SynFold ''%'' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="\V%s' . s:delimiter . '" end="\V' . s:delimiter . '" skip="\V\\\\\|\\' . s:delimiter . '" contains=rubyBackslashEscape,' . s:group . ' nextgroup=@rubyModifier skipwhite' + exe 'SynFold ''%'' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="\V%i' . s:delimiter . '" end="\V' . s:delimiter . '" skip="\V\\\\\|\\' . s:delimiter . '" contains=rubyBackslashEscape,rubySpaceEscape,' . s:group . ' nextgroup=@rubyModifier skipwhite' + exe 'hi def link ' . s:group . ' rubyStringEscape' +endfor + +unlet s:delimiter s:group s:names +" }}}2 - " Array of interpolated Symbols - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I{" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape fold - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape fold - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape fold - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape fold -else - " Array of Symbols - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i{" end="}" skip="\\\\\|\\}" contains=rubyNestedCurlyBraces,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i<" end=">" skip="\\\\\|\\>" contains=rubyNestedAngleBrackets,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\[" end="\]" skip="\\\\\|\\\]" contains=rubyNestedSquareBrackets,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i(" end=")" skip="\\\\\|\\)" contains=rubyNestedParentheses,rubyDelimiterEscape +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%q{" end="}" skip="\\\\\|\\}" contains=rubyBackslashEscape,rubyCurlyBraceEscape,rubyNestedCurlyBraces +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%q<" end=">" skip="\\\\\|\\>" contains=rubyBackslashEscape,rubyAngleBracketEscape,rubyNestedAngleBrackets +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%q\[" end="\]" skip="\\\\\|\\\]" contains=rubyBackslashEscape,rubySquareBracketEscape,rubyNestedSquareBrackets +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%q(" end=")" skip="\\\\\|\\)" contains=rubyBackslashEscape,rubyParenthesisEscape,rubyNestedParentheses +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%q\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=rubyBackslashEscape,rubySpaceEscape - " Array of interpolated Symbols - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I{" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape - syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape -endif +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%w{" end="}" skip="\\\\\|\\}" contains=rubyBackslashEscape,rubySpaceEscape,rubyCurlyBraceEscape,rubyNestedCurlyBraces +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%w<" end=">" skip="\\\\\|\\>" contains=rubyBackslashEscape,rubySpaceEscape,rubyAngleBracketEscape,rubyNestedAngleBrackets +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%w\[" end="\]" skip="\\\\\|\\\]" contains=rubyBackslashEscape,rubySpaceEscape,rubySquareBracketEscape,rubyNestedSquareBrackets +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%w(" end=")" skip="\\\\\|\\)" contains=rubyBackslashEscape,rubySpaceEscape,rubyParenthesisEscape,rubyNestedParentheses + +SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" contains=rubyBackslashEscape,rubyCurlyBraceEscape,rubyNestedCurlyBraces +SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" contains=rubyBackslashEscape,rubyAngleBracketEscape,rubyNestedAngleBrackets +SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" contains=rubyBackslashEscape,rubySquareBracketEscape,rubyNestedSquareBrackets +SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" contains=rubyBackslashEscape,rubyParenthesisEscape,rubyNestedParentheses +SynFold '%' syn region rubyString matchgroup=rubyPercentSymbolDelimiter start="%s\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=rubyBackslashEscape,rubySpaceEscape -" Here Document {{{1 -syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop -syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop -syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop -syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%i{" end="}" skip="\\\\\|\\}" contains=rubyBackslashEscape,rubySpaceEscape,rubyCurlyBraceEscape,rubyNestedCurlyBraces +SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%i<" end=">" skip="\\\\\|\\>" contains=rubyBackslashEscape,rubySpaceEscape,rubyAngleBracketEscape,rubyNestedAngleBrackets +SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%i\[" end="\]" skip="\\\\\|\\\]" contains=rubyBackslashEscape,rubySpaceEscape,rubySquareBracketEscape,rubyNestedSquareBrackets +SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%i(" end=")" skip="\\\\\|\\)" contains=rubyBackslashEscape,rubySpaceEscape,rubyParenthesisEscape,rubyNestedParentheses -if s:foldable('<<') - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc fold keepend - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend +" Generalized Double Quoted Strings, Array of Strings, Array of Symbols and Shell Command Output {{{1 +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="\%(\%(\w\|[^\x00-\x7F]\|]\)\s*\)\@<!%=" end="=" skip="\\\\\|\\=" contains=@rubyStringSpecial nextgroup=@rubyModifier skipwhite +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial nextgroup=@rubyModifier skipwhite +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial nextgroup=@rubyModifier skipwhite +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%[Qx]\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart fold keepend - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend -else - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc keepend - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend +SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial nextgroup=@rubyModifier skipwhite +SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%I{" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces +SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%I<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets +SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%I\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets +SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%I(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses + +" Here Documents {{{1 +syn region rubyHeredocStart matchgroup=rubyHeredocDelimiter start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"'`]\)\s\|\w\)\@<!<<[-~]\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart keepend - syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend -endif +syn region rubyHeredocStart matchgroup=rubyHeredocDelimiter start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"'`]\)\s\|\w\)\@<!<<[-~]\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyHeredocDelimiter start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"'`]\)\s\|\w\)\@<!<<[-~]\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyHeredocDelimiter start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"'`]\)\s\|\w\)\@<!<<[-~]\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop -" eRuby Config {{{1 -if exists('main_syntax') && main_syntax == 'eruby' - let b:ruby_no_expensive = 1 -endif +SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"'`]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyHeredocDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend +SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"'`]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyHeredocDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend +SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"'`]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyHeredocDelimiter end=+^\z1$+ contains=rubyHeredocStart keepend +SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"'`]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyHeredocDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend + +SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyHeredocDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend +SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyHeredocDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend +SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyHeredocDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart keepend +SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyHeredocDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend " Module, Class, Method and Alias Declarations {{{1 -syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable nextgroup=rubyAliasDeclaration2 skipwhite -syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable -syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable -syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyClassName,rubyOperator -syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyModuleName,rubyOperator -syn match rubyMethodName "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=rubyMethodDeclaration -syn match rubyMethodName "\%(\s\|^\)\@1<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2 -syn match rubyMethodName "\%([[:space:].]\|^\)\@2<=\%(\[\]=\=\|\*\*\|[-+!~]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration +syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,@rubyGlobalVariable nextgroup=rubyAliasDeclaration2 skipwhite +syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,@rubyGlobalVariable +syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable +syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyClassName,rubyScopeOperator nextgroup=rubySuperClassOperator skipwhite skipnl +syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyModuleName,rubyScopeOperator -syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyMethodName,rubyBlockParameter +syn match rubyMethodName "\<\%([_[:alpha:]]\|[^\x00-\x7F]\)\%([_[:alnum:]]\|[^\x00-\x7F]\)*[?!=]\=\%([[:alnum:]_.:?!=]\|[^\x00-\x7F]\)\@!" contained containedin=rubyMethodDeclaration +syn match rubyMethodName "\%(\s\|^\)\@1<=\%([_[:alpha:]]\|[^\x00-\x7F]\)\%([_[:alnum:]]\|[^\x00-\x7F]\)*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2 +syn match rubyMethodName "\%([[:space:].]\|^\)\@1<=\%(\[\]=\=\|\*\*\|[-+!~]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration + +syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyMethodName " Keywords {{{1 -" Note: the following keywords have already been defined: -" begin case class def do end for if module unless until while -syn match rubyControl "\<\%(and\|break\|in\|next\|not\|or\|redo\|rescue\|retry\|return\)\>[?!]\@!" -syn match rubyOperator "\<defined?" display -syn match rubyKeyword "\<\%(super\|yield\)\>[?!]\@!" -syn match rubyBoolean "\<\%(true\|false\)\>[?!]\@!" -syn match rubyPseudoVariable "\<\%(nil\|self\|__ENCODING__\|__dir__\|__FILE__\|__LINE__\|__callee__\|__method__\)\>[?!]\@!" " TODO: reorganise -syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>[?!]\@!" +" TODO: reorganise +syn match rubyControl "\%#=1\<\%(break\|in\|next\|redo\|retry\|return\)\>" +syn match rubyKeyword "\%#=1\<\%(super\|yield\)\>" +syn match rubyBoolean "\%#=1\<\%(true\|false\)\>[?!]\@!" +syn match rubyPseudoVariable "\%#=1\<\(self\|nil\)\>[?!]\@!" +syn match rubyPseudoVariable "\%#=1\<__\%(ENCODING\|dir\|FILE\|LINE\|callee\|method\)__\>" +syn match rubyBeginEnd "\%#=1\<\%(BEGIN\|END\)\>" " Expensive Mode {{{1 " Match 'end' with the appropriate opening keyword for syntax based folding " and special highlighting of module/class/method definitions if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") - syn match rubyDefine "\<alias\>" nextgroup=rubyAliasDeclaration skipwhite skipnl - syn match rubyDefine "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl - syn match rubyDefine "\<undef\>" nextgroup=rubyMethodName skipwhite skipnl - syn match rubyClass "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl - syn match rubyModule "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl - - if s:foldable('def') - syn region rubyMethodBlock start="\<def\>" matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold - else - syn region rubyMethodBlock start="\<def\>" matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop - endif + syn match rubyDefine "\<alias\>" nextgroup=rubyAliasDeclaration skipwhite skipnl + syn match rubyDefine "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl + syn match rubyDefine "\<undef\>" nextgroup=rubyMethodName skipwhite skipnl + syn match rubyClass "\<class\>" nextgroup=rubyClassDeclaration,rubyEigenClassOperator skipwhite skipnl + syn match rubyModule "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl - if s:foldable('class') - syn region rubyBlock start="\<class\>" matchgroup=rubyClass end="\<end\>" contains=ALLBUT,@rubyNotTop fold - else - syn region rubyBlock start="\<class\>" matchgroup=rubyClass end="\<end\>" contains=ALLBUT,@rubyNotTop - endif - - if s:foldable('module') - syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=ALLBUT,@rubyNotTop fold - else - syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=ALLBUT,@rubyNotTop - endif + SynFold 'def' syn region rubyMethodBlock start="\<def\>" matchgroup=rubyDefine skip="\<end:\|\%(\<def\_s\+\)\@<=end\>" end="\<end\>" contains=ALLBUT,@rubyNotTop + SynFold 'class' syn region rubyClassBlock start="\<class\>" matchgroup=rubyClass skip="\<end:" end="\<end\>" contains=ALLBUT,@rubyNotTop + SynFold 'module' syn region rubyModuleBlock start="\<module\>" matchgroup=rubyModule skip="\<end:" end="\<end\>" contains=ALLBUT,@rubyNotTop " modifiers - syn match rubyLineContinuation "\\$" nextgroup=rubyConditionalModifier,rubyRepeatModifier skipwhite skipnl + syn match rubyLineContinuation "\\$" nextgroup=@rubyModifier skipwhite skipnl syn match rubyConditionalModifier "\<\%(if\|unless\)\>" syn match rubyRepeatModifier "\<\%(while\|until\)\>" + syn match rubyRescueModifier "\<rescue\>" - if s:foldable('do') - syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold - else - syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyNotTop - endif + syn cluster rubyModifier contains=rubyConditionalModifier,rubyRepeatModifier,rubyRescueModifier + + SynFold 'do' syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" skip="\<end:" end="\<end\>" contains=ALLBUT,@rubyNotTop " curly bracket block or hash literal - if s:foldable('{') - syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop fold - else - syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop - endif - - if s:foldable('[') - syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@rubyNotTop fold - endif + SynFold '{' syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop + SynFold '[' syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\%(\w\|[^\x00-\x7F]\)[?!]\=\|[]})]\)\@2<!\[" end="]" contains=ALLBUT,@rubyNotTop " statements without 'do' - if s:foldable('begin') - syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold - else - syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop - endif + SynFold 'begin' syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" skip="\<end:" end="\<end\>" contains=ALLBUT,@rubyNotTop + SynFold 'case' syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" skip="\<end:" end="\<end\>" contains=ALLBUT,@rubyNotTop - if s:foldable('case') - syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold - else - syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop - endif + SynFold 'if' syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\<then\s\|\%(\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" skip="\<end:" end="\<end\>" contains=ALLBUT,@rubyNotTop - if s:foldable('if') - syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@1<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold - else - syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@1<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop - endif + syn match rubyConditional "\<\%(then\|else\|when\)\>" contained containedin=rubyCaseExpression + syn match rubyConditional "\<\%(then\|else\|elsif\)\>" contained containedin=rubyConditionalExpression - syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression - syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression - - syn match rubyExceptional "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyBlockExpression - syn match rubyMethodExceptional "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyMethodBlock + syn match rubyExceptionHandler "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>" contained containedin=rubyBlockExpression,rubyDoBlock + syn match rubyExceptionHandler2 "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>" contained containedin=rubyModuleBlock,rubyClassBlock,rubyMethodBlock + syn cluster rubyExceptionHandler contains=rubyExceptionHandler,rubyExceptionHandler2 " statements with optional 'do' - syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop + syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\<for\>" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\@<![!?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\<do\>" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop - if s:foldable('for') - syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine fold - else - syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine - endif + SynFold 'for' syn region rubyRepeatExpression start="\<for\>" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\@<![!?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat skip="\<end:" end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine if !exists("ruby_minlines") let ruby_minlines = 500 endif - exec "syn sync minlines=" . ruby_minlines + exe "syn sync minlines=" . ruby_minlines else - syn match rubyControl "\<def\>[?!]\@!" nextgroup=rubyMethodDeclaration skipwhite skipnl - syn match rubyControl "\<class\>[?!]\@!" nextgroup=rubyClassDeclaration skipwhite skipnl - syn match rubyControl "\<module\>[?!]\@!" nextgroup=rubyModuleDeclaration skipwhite skipnl - syn match rubyControl "\<\%(case\|begin\|do\|for\|if\|unless\|while\|until\|else\|elsif\|ensure\|then\|when\|end\)\>[?!]\@!" - syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!" + syn match rubyControl "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl + syn match rubyControl "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl + syn match rubyControl "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl + syn match rubyControl "\<\%(case\|begin\|do\|for\|if\|unless\|while\|until\|else\|elsif\|rescue\|ensure\|then\|when\|end\)\>" + syn match rubyKeyword "\<\%(alias\|undef\)\>" endif " Special Methods {{{1 if !exists("ruby_no_special_methods") - syn keyword rubyAccess public protected private public_class_method private_class_method public_constant private_constant module_function - " attr is a common variable name - syn match rubyAttribute "\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!" - syn keyword rubyAttribute attr_accessor attr_reader attr_writer - syn match rubyControl "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>[?!]\@!\)" - syn keyword rubyEval eval class_eval instance_eval module_eval - syn keyword rubyException raise fail catch throw - syn keyword rubyInclude autoload gem load require require_relative - syn keyword rubyKeyword callcc caller lambda proc - " false positive with 'include?' - syn match rubyMacro "\<include\>[?!]\@!" - syn keyword rubyMacro extend prepend refine using - syn keyword rubyMacro alias_method define_method define_singleton_method remove_method undef_method + syn match rubyAccess "\<\%(public\|protected\|private\)\>" " use re=2 + syn match rubyAccess "\%#=1\<\%(public\|private\)_class_method\>" + syn match rubyAccess "\%#=1\<\%(public\|private\)_constant\>" + syn match rubyAccess "\%#=1\<module_function\>" + syn match rubyAttribute "\%#=1\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!" " attr is a common variable name + syn match rubyAttribute "\%#=1\<attr_\%(accessor\|reader\|writer\)\>" + syn match rubyControl "\%#=1\<\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>" + syn match rubyEval "\%#=1\<eval\>" + syn match rubyEval "\%#=1\<\%(class\|instance\|module\)_eval\>" + syn match rubyException "\%#=1\<\%(raise\|fail\|catch\|throw\)\>" + syn match rubyInclude "\%#=1\<\%(autoload\|gem\|load\|require\%(_relative\)\=\)\>" + syn match rubyKeyword "\%#=1\<\%(callcc\|caller\|lambda\|proc\)\>" + syn match rubyMacro "\%#=1\<\%(extend\|include\|prepend\|refine\|using\)\>" + syn match rubyMacro "\%#=1\<\%(alias\|define\|define_singleton\|remove\|undef\)_method\>" endif " Comments and Documentation {{{1 -syn match rubySharpBang "\%^#!.*" display -syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained -syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell +syn match rubySharpBang "\%^#!.*" display +syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained +syn match rubyEncoding "[[:alnum:]-]\+" contained display +syn match rubyMagicComment "\c\%<3l#\s*\zs\%(coding\|encoding\):" contained nextgroup=rubyEncoding skipwhite +syn match rubyMagicComment "\c\%<10l#\s*\zs\%(frozen_string_literal\|warn_indent\|warn_past_scope\):" contained nextgroup=rubyBoolean skipwhite +syn match rubyComment "#.*" contains=@rubyCommentSpecial,rubySpaceError,@Spell + +syn cluster rubyCommentSpecial contains=rubySharpBang,rubyTodo,rubyMagicComment +syn cluster rubyCommentNotTop contains=@rubyCommentSpecial,rubyEncoding + if !exists("ruby_no_comment_fold") && s:foldable('#') syn region rubyMultilineComment start="^\s*#.*\n\%(^\s*#\)\@=" end="^\s*#.*\n\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend - syn region rubyDocumentation start="^=begin\ze\%(\s.*\)\=$" end="^=end\%(\s.*\)\=$" contains=rubySpaceError,rubyTodo,@Spell fold + syn region rubyDocumentation start="^=begin\ze\%(\s.*\)\=$" end="^=end\%(\s.*\)\=$" contains=rubySpaceError,rubyTodo,@Spell fold else - syn region rubyDocumentation start="^=begin\s*$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell + syn region rubyDocumentation start="^=begin\s*$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell endif +" {{{1 Useless Line Continuations +syn match rubyUselessLineContinuation "\%([.:,;{([<>~\*%&^|+=-]\|%(\%(\w\|[^\x00-\x7F]\)\@1<![?!]\)\s*\zs\\$" nextgroup=rubyUselessLineContinuation skipwhite skipempty +syn match rubyUselessLineContinuation "\\$" nextgroup=rubyUselessLineContinuation skipwhite skipempty contained + " Keyword Nobbling {{{1 -" Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver -syn match rubyKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%([_[:lower:]][_[:alnum:]]*\|\<\%(BEGIN\|END\)\>\)" transparent contains=NONE -syn match rubyKeywordAsMethod "\(defined?\|exit!\)\@!\<[_[:lower:]][_[:alnum:]]*[?!]" transparent contains=NONE +" prevent methods with keyword names being highlighted as keywords when called +syn match rubyKeywordAsMethod "\%(\%(\.\@1<!\.\)\|&\.\|::\)\_s*\%([_[:lower:]][_[:alnum:]]*\|\%(BEGIN\|END\)\>\)" transparent contains=rubyDotOperator,rubyScopeOperator + +" Bang and Predicate Methods and Operators {{{1 +syn match rubyBangPredicateMethod "\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[?!]" -" More Symbols {{{1 -syn match rubySymbol "\%([{(,]\_s*\)\zs\l\w*[!?]\=::\@!"he=e-1 -syn match rubySymbol "[]})\"':]\@1<!\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="he=e-1 -syn match rubySymbol "\%([{(,]\_s*\)\zs[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1 -syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="hs=s+1,he=e-1 +if !exists("ruby_no_special_methods") + syn match rubyControl "\%#=1\<exit!" display +endif +syn match rubyDefinedOperator "\%#=1\<defined?" display + +" 1.9-style Hash Keys and Keyword Parameters {{{1 +syn match rubySymbol "\%([{(|,]\_s*\)\@<=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[?!]\=::\@!"he=e-1 +syn match rubySymbol "[]})\"':]\@1<!\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],;]\@="he=e-1 +syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],;]\@="hs=s+1,he=e-1 " __END__ Directive {{{1 -if s:foldable('__END__') - syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold -else - syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" -endif +SynFold '__END__' syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" " Default Highlighting {{{1 hi def link rubyClass rubyDefine hi def link rubyModule rubyDefine -hi def link rubyMethodExceptional rubyDefine +hi def link rubyExceptionHandler2 rubyDefine hi def link rubyDefine Define hi def link rubyAccess rubyMacro hi def link rubyAttribute rubyMacro @@ -488,14 +481,15 @@ hi def link rubyFunction Function hi def link rubyConditional Conditional hi def link rubyConditionalModifier rubyConditional -hi def link rubyExceptional rubyConditional +hi def link rubyExceptionHandler rubyConditional +hi def link rubyRescueModifier rubyExceptionHandler hi def link rubyRepeat Repeat hi def link rubyRepeatModifier rubyRepeat hi def link rubyOptionalDo rubyRepeat hi def link rubyControl Statement hi def link rubyInclude Include hi def link rubyInteger Number -hi def link rubyASCIICode Character +hi def link rubyCharacter Character hi def link rubyFloat Float hi def link rubyBoolean Boolean hi def link rubyException Exception @@ -515,39 +509,80 @@ hi def link rubyPredefinedVariable rubyPredefinedIdentifier hi def link rubySymbol Constant hi def link rubyKeyword Keyword + hi def link rubyOperator Operator +hi def link rubyDefinedOperator rubyOperator +hi def link rubyEnglishBooleanOperator rubyOperator +if exists("ruby_operators") + hi def link rubyTernaryOperator rubyOperator + hi def link rubyArithmeticOperator rubyOperator + hi def link rubyComparisonOperator rubyOperator + hi def link rubyBitwiseOperator rubyOperator + hi def link rubyBooleanOperator rubyOperator + hi def link rubyRangeOperator rubyOperator + hi def link rubyAssignmentOperator rubyOperator + hi def link rubyEqualityOperator rubyOperator +endif + +if exists("ruby_pseudo_operators") + hi def link rubyPseudoOperator Special + hi def link rubyDotOperator rubyPseudoOperator + hi def link rubyScopeOperator rubyPseudoOperator + hi def link rubySuperClassOperator rubyPseudoOperator + hi def link rubyEigenClassOperator rubyPseudoOperator + hi def link rubyLambdaOperator rubyPseudoOperator + hi def link rubyDoubleSplatOperator rubyPseudoOperator + hi def link rubySplatOperator rubyPseudoOperator + hi def link rubyProcOperator rubyPseudoOperator +endif + hi def link rubyBeginEnd Statement hi def link rubyEval Statement hi def link rubyPseudoVariable Constant -hi def link rubyCapitalizedMethod rubyLocalVariableOrMethod +hi def link rubyCapitalizedMethod NONE hi def link rubyComment Comment +hi def link rubyEncoding Constant +hi def link rubyMagicComment SpecialComment hi def link rubyData Comment hi def link rubyDataDirective Delimiter hi def link rubyDocumentation Comment hi def link rubyTodo Todo +hi def link rubyBackslashEscape rubyStringEscape hi def link rubyQuoteEscape rubyStringEscape +hi def link rubySpaceEscape rubyStringEscape +hi def link rubyParenthesisEscape rubyStringEscape +hi def link rubyCurlyBraceEscape rubyStringEscape +hi def link rubyAngleBracketEscape rubyStringEscape +hi def link rubySquareBracketEscape rubyStringEscape hi def link rubyStringEscape Special + hi def link rubyInterpolationDelimiter Delimiter -hi def link rubyNoInterpolation rubyString hi def link rubySharpBang PreProc +hi def link rubyStringDelimiter Delimiter +hi def link rubyHeredocDelimiter rubyStringDelimiter +hi def link rubyPercentRegexpDelimiter rubyRegexpDelimiter +hi def link rubyPercentStringDelimiter rubyStringDelimiter +hi def link rubyPercentSymbolDelimiter rubySymbolDelimiter hi def link rubyRegexpDelimiter rubyStringDelimiter hi def link rubySymbolDelimiter rubySymbol -hi def link rubyStringDelimiter Delimiter -hi def link rubyHeredoc rubyString hi def link rubyString String hi def link rubyRegexpEscape rubyRegexpSpecial hi def link rubyRegexpQuantifier rubyRegexpSpecial hi def link rubyRegexpAnchor rubyRegexpSpecial hi def link rubyRegexpDot rubyRegexpCharClass hi def link rubyRegexpCharClass rubyRegexpSpecial +hi def link rubyRegexpIntersection rubyRegexpSpecial hi def link rubyRegexpSpecial Special hi def link rubyRegexpComment Comment hi def link rubyRegexp rubyString -hi def link rubyInvalidVariable Error hi def link rubyError Error +if exists("ruby_line_continuation_error") + hi def link rubyUselessLineContinuation rubyError +endif +hi def link rubyGlobalVariableError rubyError hi def link rubySpaceError rubyError " Postscript {{{1 @@ -556,4 +591,6 @@ let &cpo = s:cpo_sav unlet! s:cpo_sav +delc SynFold + " vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
--- a/vendor/vim-syntax/scss.vim Mon Jan 13 00:19:42 2020 +0900 +++ b/vendor/vim-syntax/scss.vim Tue Jan 14 11:09:50 2020 +0900 @@ -2,7 +2,7 @@ " Language: SCSS " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Filenames: *.scss -" Last Change: 2010 Jul 26 +" Last Change: 2019 Dec 05 if exists("b:current_syntax") finish @@ -10,10 +10,15 @@ runtime! syntax/sass.vim +syn clear sassComment +syn clear sassCssComment +syn clear sassEndOfLineComment + syn match scssComment "//.*" contains=sassTodo,@Spell -syn region scssComment start="/\*" end="\*/" contains=sassTodo,@Spell +syn region scssCssComment start="/\*" end="\*/" contains=sassTodo,@Spell -hi def link scssComment sassComment +hi def link scssCssComment scssComment +hi def link scssComment Comment let b:current_syntax = "scss"
--- a/vendor/vim-syntax/typescript.vim Mon Jan 13 00:19:42 2020 +0900 +++ b/vendor/vim-syntax/typescript.vim Tue Jan 14 11:09:50 2020 +0900 @@ -1,339 +1,47 @@ " Vim syntax file -" Language: typescript -" Author: MicroSoft Open Technologies Inc. -" Version: 0.1 -" Credits: Zhao Yi, Claudio Fleiner, Scott Shattuck, Jose Elera Campana +" Language: TypeScript +" Maintainer: Bram Moolenaar, Herrington Darkholme +" Last Change: 2019 Nov 30 +" Based On: Herrington Darkholme's yats.vim +" Changes: Go to https:github.com/HerringtonDarkholme/yats.vim for recent changes. +" Origin: https://github.com/othree/yajs +" Credits: Kao Wei-Ko(othree), Jose Elera Campana, Zhao Yi, Claudio Fleiner, Scott Shattuck +" (This file is based on their hard work), gumnos (From the #vim +" IRC Channel in Freenode) + +" This is the same syntax that is in yats.vim, but: +" - flattened into one file +" - HiLink commands changed to "hi def link" +" - Setting 'cpo' to the Vim value if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") + if exists("b:current_syntax") finish endif - let main_syntax = "typescript" -endif - -" Drop fold if it set but vim doesn't support it. -if version < 600 && exists("typescript_fold") - unlet typescript_fold + let main_syntax = 'typescript' endif -"" dollar sign is permitted anywhere in an identifier -setlocal iskeyword+=$ - -syntax sync fromstart - -"" syntax coloring for Node.js shebang line -syn match shebang "^#!.*/bin/env\s\+node\>" -hi link shebang Comment - -"" typescript comments"{{{ -syn keyword typescriptCommentTodo TODO FIXME XXX TBD contained -syn match typescriptLineComment "\/\/.*" contains=@Spell,typescriptCommentTodo,typescriptRef -syn match typescriptRefComment /\/\/\/<\(reference\|amd-\(dependency\|module\)\)\s\+.*\/>$/ contains=typescriptRefD,typescriptRefS -syn region typescriptRefD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ -syn region typescriptRefS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ - -syn match typescriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)" -syn region typescriptComment start="/\*" end="\*/" contains=@Spell,typescriptCommentTodo extend -"}}} -"" JSDoc support start"{{{ -if !exists("typescript_ignore_typescriptdoc") - syntax case ignore - -" syntax coloring for JSDoc comments (HTML) -"unlet b:current_syntax - - syntax region typescriptDocComment start="/\*\*\s*$" end="\*/" contains=typescriptDocTags,typescriptCommentTodo,typescriptCvsTag,@typescriptHtml,@Spell fold extend - syntax match typescriptDocTags contained "@\(param\|argument\|requires\|exception\|throws\|type\|class\|extends\|see\|link\|member\|module\|method\|title\|namespace\|optional\|default\|base\|file\|returns\=\)\>" nextgroup=typescriptDocParam,typescriptDocSeeTag skipwhite - syntax match typescriptDocTags contained "@\(beta\|deprecated\|description\|fileoverview\|author\|license\|version\|constructor\|private\|protected\|final\|ignore\|addon\|exec\)\>" - syntax match typescriptDocParam contained "\%(#\|\w\|\.\|:\|\/\)\+" - syntax region typescriptDocSeeTag contained matchgroup=typescriptDocSeeTag start="{" end="}" contains=typescriptDocTags - - syntax case match -endif "" JSDoc end -"}}} -syntax case match - -"" Syntax in the typescript code"{{{ -syn match typescriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}" contained containedin=typescriptStringD,typescriptStringS,typescriptStringB display -syn region typescriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=typescriptSpecial,@htmlPreproc extend -syn region typescriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=typescriptSpecial,@htmlPreproc extend -syn region typescriptStringB start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=typescriptInterpolation,typescriptSpecial,@htmlPreproc extend - -syn region typescriptInterpolation matchgroup=typescriptInterpolationDelimiter - \ start=/${/ end=/}/ contained - \ contains=@typescriptExpression - -syn match typescriptNumber "-\=\<\d[0-9_]*L\=\>" display -syn match typescriptNumber "-\=\<0[xX][0-9a-fA-F][0-9a-fA-F_]*\>" display -syn match typescriptNumber "-\=\<0[bB][01][01_]*\>" display -syn match typescriptNumber "-\=\<0[oO]\o[0-7_]*\>" display -syn region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline -" syntax match typescriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\." -" syntax region typescriptStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=typescriptSpecial,@htmlPreproc -" syntax region typescriptStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=typescriptSpecial,@htmlPreproc -" syntax region typescriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=typescriptSpecial,@htmlPreproc oneline -" syntax match typescriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/ -syntax match typescriptFloat /\<-\=\%(\d[0-9_]*\.\d[0-9_]*\|\d[0-9_]*\.\|\.\d[0-9]*\)\%([eE][+-]\=\d[0-9_]*\)\=\>/ -" syntax match typescriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/ +let s:cpo_save = &cpo +set cpo&vim -syn match typescriptDecorators /@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>/ -"}}} -"" typescript Prototype"{{{ -syntax keyword typescriptPrototype contained prototype -"}}} -" DOM, Browser and Ajax Support {{{ -"""""""""""""""""""""""" -if get(g:, 'typescript_ignore_browserwords', 0) - syntax keyword typescriptBrowserObjects window navigator screen history location - - syntax keyword typescriptDOMObjects document event HTMLElement Anchor Area Base Body Button Form Frame Frameset Image Link Meta Option Select Style Table TableCell TableRow Textarea - syntax keyword typescriptDOMMethods contained createTextNode createElement insertBefore replaceChild removeChild appendChild hasChildNodes cloneNode normalize isSupported hasAttributes getAttribute setAttribute removeAttribute getAttributeNode setAttributeNode removeAttributeNode getElementsByTagName hasAttribute getElementById adoptNode close compareDocumentPosition createAttribute createCDATASection createComment createDocumentFragment createElementNS createEvent createExpression createNSResolver createProcessingInstruction createRange createTreeWalker elementFromPoint evaluate getBoxObjectFor getElementsByClassName getSelection getUserData hasFocus importNode - syntax keyword typescriptDOMProperties contained nodeName nodeValue nodeType parentNode childNodes firstChild lastChild previousSibling nextSibling attributes ownerDocument namespaceURI prefix localName tagName - - syntax keyword typescriptAjaxObjects XMLHttpRequest - syntax keyword typescriptAjaxProperties contained readyState responseText responseXML statusText - syntax keyword typescriptAjaxMethods contained onreadystatechange abort getAllResponseHeaders getResponseHeader open send setRequestHeader - - syntax keyword typescriptPropietaryObjects ActiveXObject - syntax keyword typescriptPropietaryMethods contained attachEvent detachEvent cancelBubble returnValue - - syntax keyword typescriptHtmlElemProperties contained className clientHeight clientLeft clientTop clientWidth dir href id innerHTML lang length offsetHeight offsetLeft offsetParent offsetTop offsetWidth scrollHeight scrollLeft scrollTop scrollWidth style tabIndex target title - - syntax keyword typescriptEventListenerKeywords contained blur click focus mouseover mouseout load item - - syntax keyword typescriptEventListenerMethods contained scrollIntoView addEventListener dispatchEvent removeEventListener preventDefault stopPropagation -endif -" }}} -"" Programm Keywords"{{{ -syntax keyword typescriptSource import export from as -syntax keyword typescriptIdentifier arguments this void -syntax keyword typescriptStorageClass let var const -syntax keyword typescriptOperator delete new instanceof typeof -syntax keyword typescriptBoolean true false -syntax keyword typescriptNull null undefined -syntax keyword typescriptMessage alert confirm prompt status -syntax keyword typescriptGlobal self top parent -syntax keyword typescriptDeprecated escape unescape all applets alinkColor bgColor fgColor linkColor vlinkColor xmlEncoding -"}}} -"" Statement Keywords"{{{ -syntax keyword typescriptConditional if else switch -syntax keyword typescriptRepeat do while for in of -syntax keyword typescriptBranch break continue yield await -syntax keyword typescriptLabel case default async readonly -syntax keyword typescriptStatement return with - -syntax keyword typescriptGlobalObjects Array Boolean Date Function Infinity JSON Math Number NaN Object Packages RegExp String Symbol netscape - -syntax keyword typescriptExceptions try catch throw finally Error EvalError RangeError ReferenceError SyntaxError TypeError URIError - -syntax keyword typescriptReserved constructor declare as interface module abstract enum int short export interface static byte extends long super char final native synchronized class float package throws goto private transient debugger implements protected volatile double import public type namespace from get set keyof -"}}} -"" typescript/DOM/HTML/CSS specified things"{{{ - -" typescript Objects"{{{ - syn match typescriptFunction "(super\s*|constructor\s*)" contained nextgroup=typescriptVars - syn region typescriptVars start="(" end=")" contained contains=typescriptParameters transparent keepend - syn match typescriptParameters "([a-zA-Z0-9_?.$][\w?.$]*)\s*:\s*([a-zA-Z0-9_?.$][\w?.$]*)" contained skipwhite -"}}} -" DOM2 Objects"{{{ - syntax keyword typescriptType DOMImplementation DocumentFragment Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction void any string boolean number symbol never object unknown - syntax keyword typescriptExceptions DOMException -"}}} -" DOM2 CONSTANT"{{{ - syntax keyword typescriptDomErrNo INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR - syntax keyword typescriptDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE -"}}} -" HTML events and internal variables"{{{ - syntax case ignore - syntax keyword typescriptHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize onload onsubmit - syntax case match -"}}} - -" Follow stuff should be highligh within a special context -" While it can't be handled with context depended with Regex based highlight -" So, turn it off by default -if exists("typescript_enable_domhtmlcss") - -" DOM2 things"{{{ - syntax match typescriptDomElemAttrs contained /\%(nodeName\|nodeValue\|nodeType\|parentNode\|childNodes\|firstChild\|lastChild\|previousSibling\|nextSibling\|attributes\|ownerDocument\|namespaceURI\|prefix\|localName\|tagName\)\>/ - syntax match typescriptDomElemFuncs contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=typescriptParen skipwhite -"}}} -" HTML things"{{{ - syntax match typescriptHtmlElemAttrs contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/ - syntax match typescriptHtmlElemFuncs contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=typescriptParen skipwhite -"}}} -" CSS Styles in typescript"{{{ - syntax keyword typescriptCssStyles contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition - syntax keyword typescriptCssStyles contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition - syntax keyword typescriptCssStyles contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode - syntax keyword typescriptCssStyles contained bottom height left position right top width zIndex - syntax keyword typescriptCssStyles contained border borderBottom borderLeft borderRight borderTop borderBottomColor borderLeftColor borderTopColor borderBottomStyle borderLeftStyle borderRightStyle borderTopStyle borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderColor borderStyle borderWidth borderCollapse borderSpacing captionSide emptyCells tableLayout - syntax keyword typescriptCssStyles contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop - syntax keyword typescriptCssStyles contained listStyle listStyleImage listStylePosition listStyleType - syntax keyword typescriptCssStyles contained background backgroundAttachment backgroundColor backgroundImage backgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat - syntax keyword typescriptCssStyles contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType - syntax keyword typescriptCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText - syntax keyword typescriptCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor -"}}} -endif "DOM/HTML/CSS - -" Highlight ways"{{{ -syntax match typescriptDotNotation "\." nextgroup=typescriptPrototype,typescriptDomElemAttrs,typescriptDomElemFuncs,typescriptDOMMethods,typescriptDOMProperties,typescriptHtmlElemAttrs,typescriptHtmlElemFuncs,typescriptHtmlElemProperties,typescriptAjaxProperties,typescriptAjaxMethods,typescriptPropietaryMethods,typescriptEventListenerMethods skipwhite skipnl -syntax match typescriptDotNotation "\.style\." nextgroup=typescriptCssStyles -"}}} - -"" end DOM/HTML/CSS specified things""}}} +" this region is NOT used in TypeScriptReact +" nextgroup doesn't contain objectLiteral, let outer region contains it +syntax region typescriptTypeCast matchgroup=typescriptTypeBrackets + \ start=/< \@!/ end=/>/ + \ contains=@typescriptType + \ nextgroup=@typescriptExpression + \ contained skipwhite oneline -"" Code blocks -syntax cluster typescriptAll contains=typescriptComment,typescriptLineComment,typescriptDocComment,typescriptStringD,typescriptStringS,typescriptStringB,typescriptRegexpString,typescriptNumber,typescriptFloat,typescriptDecorators,typescriptLabel,typescriptSource,typescriptType,typescriptOperator,typescriptBoolean,typescriptNull,typescriptFuncKeyword,typescriptConditional,typescriptGlobal,typescriptRepeat,typescriptBranch,typescriptStatement,typescriptGlobalObjects,typescriptMessage,typescriptIdentifier,typescriptStorageClass,typescriptExceptions,typescriptReserved,typescriptDeprecated,typescriptDomErrNo,typescriptDomNodeConsts,typescriptHtmlEvents,typescriptDotNotation,typescriptBrowserObjects,typescriptDOMObjects,typescriptAjaxObjects,typescriptPropietaryObjects,typescriptDOMMethods,typescriptHtmlElemProperties,typescriptDOMProperties,typescriptEventListenerKeywords,typescriptEventListenerMethods,typescriptAjaxProperties,typescriptAjaxMethods,typescriptFuncArg - -if main_syntax == "typescript" - syntax sync clear - syntax sync ccomment typescriptComment minlines=200 -" syntax sync match typescriptHighlight grouphere typescriptBlock /{/ -endif - -syntax keyword typescriptFuncKeyword function -"syntax region typescriptFuncDef start="function" end="\(.*\)" contains=typescriptFuncKeyword,typescriptFuncArg keepend -"syntax match typescriptFuncArg "\(([^()]*)\)" contains=typescriptParens,typescriptFuncComma contained -"syntax match typescriptFuncComma /,/ contained -" syntax region typescriptFuncBlock contained matchgroup=typescriptFuncBlock start="{" end="}" contains=@typescriptAll,typescriptParensErrA,typescriptParensErrB,typescriptParen,typescriptBracket,typescriptBlock fold - -syn match typescriptBraces "[{}\[\]]" -syn match typescriptParens "[()]" -syn match typescriptOpSymbols "=\{1,3}\|!==\|!=\|<\|>\|>=\|<=\|++\|+=\|--\|-=" -syn match typescriptEndColons "[;,]" -syn match typescriptLogicSymbols "\(&&\)\|\(||\)\|\(!\)" - -" typescriptFold Function {{{ - -" function! typescriptFold() - -" skip curly braces inside RegEx's and comments -syn region foldBraces start=/{/ skip=/\(\/\/.*\)\|\(\/.*\/\)/ end=/}/ transparent fold keepend extend - -" setl foldtext=FoldText() -" endfunction - -" au FileType typescript call typescriptFold() - -" }}} - -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_typescript_syn_inits") - if version < 508 - let did_typescript_syn_inits = 1 - command -nargs=+ HiLink hi link <args> - else - command -nargs=+ HiLink hi def link <args> - endif - - "typescript highlighting - HiLink typescriptParameters Operator - HiLink typescriptSuperBlock Operator +""""""""""""""""""""""""""""""""""""""""""""""""""" +" Source the part common with typescriptreact.vim +source <sfile>:h/typescriptcommon.vim - HiLink typescriptEndColons Exception - HiLink typescriptOpSymbols Operator - HiLink typescriptLogicSymbols Boolean - HiLink typescriptBraces Function - HiLink typescriptParens Operator - HiLink typescriptComment Comment - HiLink typescriptLineComment Comment - HiLink typescriptRefComment Include - HiLink typescriptRefS String - HiLink typescriptRefD String - HiLink typescriptDocComment Comment - HiLink typescriptCommentTodo Todo - HiLink typescriptCvsTag Function - HiLink typescriptDocTags Special - HiLink typescriptDocSeeTag Function - HiLink typescriptDocParam Function - HiLink typescriptStringS String - HiLink typescriptStringD String - HiLink typescriptStringB String - HiLink typescriptInterpolationDelimiter Delimiter - HiLink typescriptRegexpString String - HiLink typescriptGlobal Constant - HiLink typescriptCharacter Character - HiLink typescriptPrototype Type - HiLink typescriptConditional Conditional - HiLink typescriptBranch Conditional - HiLink typescriptIdentifier Identifier - HiLink typescriptStorageClass StorageClass - HiLink typescriptRepeat Repeat - HiLink typescriptStatement Statement - HiLink typescriptFuncKeyword Function - HiLink typescriptMessage Keyword - HiLink typescriptDeprecated Exception - HiLink typescriptError Error - HiLink typescriptParensError Error - HiLink typescriptParensErrA Error - HiLink typescriptParensErrB Error - HiLink typescriptParensErrC Error - HiLink typescriptReserved Keyword - HiLink typescriptOperator Operator - HiLink typescriptType Type - HiLink typescriptNull Type - HiLink typescriptNumber Number - HiLink typescriptFloat Number - HiLink typescriptDecorators Special - HiLink typescriptBoolean Boolean - HiLink typescriptLabel Label - HiLink typescriptSpecial Special - HiLink typescriptSource Special - HiLink typescriptGlobalObjects Special - HiLink typescriptExceptions Special - - HiLink typescriptDomErrNo Constant - HiLink typescriptDomNodeConsts Constant - HiLink typescriptDomElemAttrs Label - HiLink typescriptDomElemFuncs PreProc - - HiLink typescriptHtmlElemAttrs Label - HiLink typescriptHtmlElemFuncs PreProc - - HiLink typescriptCssStyles Label - - " Ajax Highlighting - HiLink typescriptBrowserObjects Constant - - HiLink typescriptDOMObjects Constant - HiLink typescriptDOMMethods Function - HiLink typescriptDOMProperties Special - - HiLink typescriptAjaxObjects Constant - HiLink typescriptAjaxMethods Function - HiLink typescriptAjaxProperties Special - - HiLink typescriptFuncDef Title - HiLink typescriptFuncArg Special - HiLink typescriptFuncComma Operator - - HiLink typescriptHtmlEvents Special - HiLink typescriptHtmlElemProperties Special - - HiLink typescriptEventListenerKeywords Keyword - - HiLink typescriptNumber Number - HiLink typescriptPropietaryObjects Constant - - delcommand HiLink -endif - -" Define the htmltypescript for HTML syntax html.vim -"syntax clear htmltypescript -"syntax clear typescriptExpression -syntax cluster htmltypescript contains=@typescriptAll,typescriptBracket,typescriptParen,typescriptBlock,typescriptParenError -syntax cluster typescriptExpression contains=@typescriptAll,typescriptBracket,typescriptParen,typescriptBlock,typescriptParenError,@htmlPreproc let b:current_syntax = "typescript" if main_syntax == 'typescript' unlet main_syntax endif -" vim: ts=4 +let &cpo = s:cpo_save +unlet s:cpo_save
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/vim-syntax/typescriptreact.vim Tue Jan 14 11:09:50 2020 +0900 @@ -0,0 +1,160 @@ +" Vim syntax file +" Language: TypeScript with React (JSX) +" Maintainer: Bram Moolenaar +" Last Change: 2019 Nov 30 +" Based On: Herrington Darkholme's yats.vim +" Changes: See https:github.com/HerringtonDarkholme/yats.vim +" Credits: See yats.vim on github + +if !exists("main_syntax") + if exists("b:current_syntax") + finish + endif + let main_syntax = 'typescriptreact' +endif + +let s:cpo_save = &cpo +set cpo&vim + +syntax region tsxTag + \ start=+<\([^/!?<>="':]\+\)\@=+ + \ skip=+</[^ /!?<>"']\+>+ + \ end=+/\@<!>+ + \ end=+\(/>\)\@=+ + \ contained + \ contains=tsxTagName,tsxIntrinsicTagName,tsxAttrib,tsxEscJs, + \tsxCloseString,@tsxComment + +syntax match tsxTag /<>/ contained + + +" <tag></tag> +" s~~~~~~~~~e +" and self close tag +" <tag/> +" s~~~~e +" A big start regexp borrowed from https://git.io/vDyxc +syntax region tsxRegion + \ start=+<\_s*\z([a-zA-Z1-9\$_-]\+\(\.\k\+\)*\)+ + \ skip=+<!--\_.\{-}-->+ + \ end=+</\_s*\z1>+ + \ matchgroup=tsxCloseString end=+/>+ + \ fold + \ contains=tsxRegion,tsxCloseString,tsxCloseTag,tsxTag,tsxCommentInvalid,tsxFragment,tsxEscJs,@Spell + \ keepend + \ extend + +" <> </> +" s~~~~~~e +" A big start regexp borrowed from https://git.io/vDyxc +syntax region tsxFragment + \ start=+\(\((\|{\|}\|\[\|,\|&&\|||\|?\|:\|=\|=>\|\Wreturn\|^return\|\Wdefault\|^\|>\)\_s*\)\@<=<>+ + \ skip=+<!--\_.\{-}-->+ + \ end=+</>+ + \ fold + \ contains=tsxRegion,tsxCloseString,tsxCloseTag,tsxTag,tsxCommentInvalid,tsxFragment,tsxEscJs,@Spell + \ keepend + \ extend + +" </tag> +" ~~~~~~ +syntax match tsxCloseTag + \ +</\_s*[^/!?<>"']\+>+ + \ contained + \ contains=tsxTagName,tsxIntrinsicTagName + +syntax match tsxCloseTag +</>+ contained + +syntax match tsxCloseString + \ +/>+ + \ contained + +" <!-- --> +" ~~~~~~~~ +syntax match tsxCommentInvalid /<!--\_.\{-}-->/ display + +syntax region tsxBlockComment + \ contained + \ start="/\*" + \ end="\*/" + +syntax match tsxLineComment + \ "//.*$" + \ contained + \ display + +syntax cluster tsxComment contains=tsxBlockComment,tsxLineComment + +syntax match tsxEntity "&[^; \t]*;" contains=tsxEntityPunct +syntax match tsxEntityPunct contained "[&.;]" + +" <tag key={this.props.key}> +" ~~~ +syntax match tsxTagName + \ +[</]\_s*[^/!?<>"'* ]\++hs=s+1 + \ contained + \ nextgroup=tsxAttrib + \ skipwhite + \ display +syntax match tsxIntrinsicTagName + \ +[</]\_s*[a-z1-9-]\++hs=s+1 + \ contained + \ nextgroup=tsxAttrib + \ skipwhite + \ display + +" <tag key={this.props.key}> +" ~~~ +syntax match tsxAttrib + \ +[a-zA-Z_][-0-9a-zA-Z_]*+ + \ nextgroup=tsxEqual skipwhite + \ contained + \ display + +" <tag id="sample"> +" ~ +syntax match tsxEqual +=+ display contained + \ nextgroup=tsxString skipwhite + +" <tag id="sample"> +" s~~~~~~e +syntax region tsxString contained start=+"+ end=+"+ contains=tsxEntity,@Spell display + +" <tag key={this.props.key}> +" s~~~~~~~~~~~~~~e +syntax region tsxEscJs + \ contained + \ contains=@typescriptValue,@tsxComment + \ matchgroup=typescriptBraces + \ start=+{+ + \ end=+}+ + \ extend + + +""""""""""""""""""""""""""""""""""""""""""""""""""" +" Source the part common with typescriptreact.vim +source <sfile>:h/typescriptcommon.vim + + +syntax cluster typescriptExpression add=tsxRegion,tsxFragment + +hi def link tsxTag htmlTag +hi def link tsxTagName Function +hi def link tsxIntrinsicTagName htmlTagName +hi def link tsxString String +hi def link tsxNameSpace Function +hi def link tsxCommentInvalid Error +hi def link tsxBlockComment Comment +hi def link tsxLineComment Comment +hi def link tsxAttrib Type +hi def link tsxEscJs tsxEscapeJs +hi def link tsxCloseTag htmlTag +hi def link tsxCloseString Identifier + +let b:current_syntax = "typescriptreact" +if main_syntax == 'typescriptreact' + unlet main_syntax +endif + +let &cpo = s:cpo_save +unlet s:cpo_save