aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar iamdi <helloiamdi@gmail.com>2020-06-20 20:10:58 +1000
committerGravatar GitHub <noreply@github.com>2020-06-20 12:10:58 +0200
commit1bd44ade46f3fa414c86bd5688f0977677bbb769 (patch)
tree126a25dec97b4167d31d7ddb323bfa9bdb02a8ef
parente26b5d8bc05b8394144922c64bc95bd25915b3fc (diff)
downloadnord-vim-1bd44ade46f3fa414c86bd5688f0977677bbb769.tar.gz
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 <development@arcticicestudio.com> Co-authored-by: Sven Greb <development@svengreb.de>
-rwxr-xr-xcolors/nord.vim41
1 files changed, 41 insertions, 0 deletions
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, "", "", "")