leafgarland / typescript-vim

Typescript syntax files for Vim
1.9k stars 144 forks source link

Highlight classes names and methods names? #119

Open harg opened 7 years ago

harg commented 7 years ago

Is it possible to highlight classes names and methods names?

_no_name____-_vim2

leafgarland commented 7 years ago

Yes it is possible but only by adding new syntax matches to this syntax. Essentially that means defining regex patterns that will match those class and method names.

Zabanaa commented 7 years ago

Do you know any resources on how to create syntax files ? I'd love to take care of this. PS: thanks for the wonderful plugin

leafgarland commented 7 years ago

Hi @Zabanaa, a good place to start with any vimscript learnings is Steve Losh's Learn Vimscript the Hardway. There are two chapters in there on syntax highlighting. Also the built-in help, the user-guide :help usr_44 and reference :help syn-define.

I would be very happy to get more contributions on this, thanks.

harg commented 7 years ago

@Zabanaa maybe you can check https://github.com/pangloss/vim-javascript for inspiration

tommyc38 commented 3 years ago

vim's built in typescript syntax highlighter does this. The problem I had with the native solution was that it breaks on template strings (e.g. backticks)...which is why I tried out this plugin. I also notice that =|!|false|true are different colors than what the theming states they should be. This essentially breaks any native themes. There has to be something that isn't mapped correctly.