0

I am trying to install yats.vim for TypeScript syntax. I used the usual Plug 'HerringtonDarkholme/yats.vim' in my vimrc. However, once I run PlugInstall the syntax highlighting in all .ts files is still the default highlighting from Vim.

Is there anyway to make sure this gets overridden?

4
  • Could you tell us why you think why you still have the default syntax highlighting? Could you share an example of typescript file, the expected colorization/syntax and the obtained colorization/syntax (screenshot will help). Commented Oct 13 at 4:51
  • Could you tell us which version of Vim you are using (:version)? Commented Oct 13 at 5:06
  • Vim is running version 9.1. The reason I think it isn't working is the syntax highlighting without the package installed is no different to when the package is installed. Commented Oct 13 at 5:46
  • As an example, when yats.vim is installed the keyword as is not highlighted when associating types (casting). Commented Oct 13 at 5:49

1 Answer 1

0

The typescript syntax of recent version of Vim (e.g. Vim 9.1) is based Herrington Darkholme's yats.vim I expect very little differences between the Herrington Darkholme's syntax and the default Vim typescript syntax for recent version of Vim.

To determine the highlight group of a keyword or construction you could:

  • Move your cursor on the keyword or construction
  • Run: echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')

For both syntax (the Vim 9.1 default or the HerringtonDarkholme's version) the highlight group of the as keyword is: typescriptCastKeyword.

Remark: It could be that you don't get the color you want because of the colorscheme you use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.