1

I'm having trouble getting good syntax highlighting for typescript files. The issue is that reserved words are highlighted as Error:

screenshot showing interface keyword highlighted as error

Looking at :scriptnames I see the default typescript highlighting being sourced, and later leafgarland/typescript-vim being sourced. I'd expect the second to override the first, but looking at both sources, the Error highlighting comes from the default typescript highlighting (why?), whereas typescript-vim highlights keywords as Keyword.

How can I fix things so my typescript keywords don't look like errors?

Software and version details:

  • WSL running Ubuntu 22.04 under windows 11
  • VIM 8.2
  • typescript-vim at latest available commit (8d169e16b)
6
  • 1
    I tried upgrading vim to 9.0 since I realized 8.2 is quite old, but it has the same issue. Commented Oct 15, 2024 at 7:55
  • 1
    Removing typescript-vim seems to have fixed the issue! Still curious where it is coming from. Commented Oct 15, 2024 at 7:58
  • 1
    NOTE: This Typescript syntax was created before Typescript's 1.0 release, more than a decade ago. - I wonder if that's anything to do with it... Commented Oct 15, 2024 at 8:17
  • Probably... it's weird though, it works without issues in Cygwin and on macos. Commented Oct 15, 2024 at 12:38
  • 1
    That's a good guess, that did cause issues for me earlier, but I'm currently using vim-athena which I think is very similar. Commented Oct 15, 2024 at 13:30

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.