From 1bd44ade46f3fa414c86bd5688f0977677bbb769 Mon Sep 17 00:00:00 2001 From: iamdi Date: Sat, 20 Jun 2020 20:10:58 +1000 Subject: Add basic TypeScript and improve TSX support (#208) Basic highlighting support for TypeScript & TSX Added basic support to highlight TypeScript & TSX syntax more consistently through the HerringtonDarkholme/yats.vim plugin [1]. This includes improvements to highlight... 1. ...TypeScript interface an class names using `nord7` as foreground, where interfaces also use the bold attribute, to match with structs/classes. 2. ...global methods like e.g. `setTimeout` with `nord8` using the italic attribute to mark it kind of static. 3. ...regular expressions with `nord13` as foreground color instead of the normal color for quoted strings (`nord14`) to make it easier to differ between both. 4. ...global objects like `Error`, `JSON` and `console` with `nord7`. 5. ...primitive/builtin types like `string` with `nord9`. 6. ...TypeScript type references with `nord7`. 7. ...TypeScript specific characters like for type annotations (`:`) and member optionality (`?`) as operator with `nord9`. This also includes improvements for "vanilla" JavaScript elements. [1]: https://github.com/HerringtonDarkholme/yats.vim Resolves GH-208 Co-authored-by: Arctic Ice Studio Co-authored-by: Sven Greb --- colors/nord.vim | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/colors/nord.vim b/colors/nord.vim index 649b133..f3dc4c4 100755 --- a/colors/nord.vim +++ b/colors/nord.vim @@ -646,6 +646,47 @@ hi! link jsNoise Delimiter hi! link jsPrototype Keyword hi! link jsRegexpString SpecialChar +" TypeScript +" > HerringtonDarkholme/yats.vim +call s:hi("typescriptBOMWindowMethod", s:nord8_gui, "", s:nord8_term, "", s:italic, "") +call s:hi("typescriptClassName", s:nord7_gui, "", s:nord7_term, "", "", "") +call s:hi("typescriptDecorator", s:nord12_gui, "", s:nord12_term, "", "", "") +call s:hi("typescriptInterfaceName", s:nord7_gui, "", s:nord7_term, "", s:bold, "") +call s:hi("typescriptRegexpString", s:nord13_gui, "", s:nord13_term, "", "", "") +" TypeScript JSX + call s:hi("tsxAttrib", s:nord7_gui, "", s:nord7_term, "", "", "") +hi! link typescriptOperator Operator +hi! link typescriptBinaryOp Operator +hi! link typescriptAssign Operator +hi! link typescriptMember Identifier +hi! link typescriptDOMStorageMethod Identifier +hi! link typescriptArrowFuncArg Identifier +hi! link typescriptGlobal typescriptClassName +hi! link typescriptBOMWindowProp Function +hi! link typescriptArrowFuncDef Function +hi! link typescriptAliasDeclaration Function +hi! link typescriptPredefinedType Type +hi! link typescriptTypeReference typescriptClassName +hi! link typescriptTypeAnnotation Structure +hi! link typescriptDocNamedParamType SpecialComment +hi! link typescriptDocNotation Keyword +hi! link typescriptDocTags Keyword +hi! link typescriptImport Keyword +hi! link typescriptExport Keyword +hi! link typescriptTry Keyword +hi! link typescriptVariable Keyword +hi! link typescriptBraces Normal +hi! link typescriptObjectLabel Normal +hi! link typescriptCall Normal +hi! link typescriptClassHeritage typescriptClassName +hi! link typescriptFuncTypeArrow Structure +hi! link typescriptMemberOptionality Structure +hi! link typescriptNodeGlobal typescriptGlobal +hi! link typescriptTypeBrackets Structure +hi! link tsxEqual Operator +hi! link tsxIntrinsicTagName htmlTag +hi! link tsxTagName tsxIntrinsicTagName + " Markdown " > plasticboy/vim-markdown call s:hi("mkdCode", s:nord7_gui, "", s:nord7_term, "", "", "") -- cgit v1.2.3-70-g09d2