highlight link jsThis jsReturn
highlight link jsStorageClass jsClassKeyword
highlight link jsModuleKeywords jsClassKeyword
highlight link jsModuleOperators jsClassKeyword
highlight link jsArrowFunction NONE
highlight link jsImport jsClassKeyword
highlight link jsFrom jsClassKeyword
highlight link jsExport jsClassKeyword
highlight link jsExportDefault jsFuncName

syntax keyword flowTypeKeyword type nextgroup=flowTypeIdentifier
syntax region flowTypeIdentifier contained start=/\%(\s\+\k\)/ end=/=\@=/ nextgroup=jsFlowTypeValue
syntax match flowObjectProps contained /[0-9a-zA-Z_$?]*\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsFlowTypeValue containedin=jsFlowObject

highlight link jsThis jsReturn
highlight link jsStorageClass jsClassKeyword
highlight link jsModuleKeywords jsClassKeyword
highlight link jsModuleOperators jsClassKeyword
highlight link jsArrowFunction NONE
highlight link jsImport jsClassKeyword
highlight link jsFrom jsClassKeyword
highlight link jsExport jsClassKeyword
highlight link jsExportDefault jsFuncName
highlight link jsFlowTypeKeyword Keyword
highlight link flowTypeKeyword Keyword
highlight link flowTypeIdentifier Function
highlight link flowObjectProps Special

Improve flow type syntax highlighting
Improve flow type syntax highlighting

vim-javascript makes everything one colour (like a type), which makes it
look like some sort of comment, but I prefer to have it as a regular
language construct.
To be able to distinguish the type annotations from an object, it uses
different colours for the keys and all values use the type colour.

jungomi/dotfiles