typescript-vim icon indicating copy to clipboard operation
typescript-vim copied to clipboard

Highlight classes names and methods names?

Open harg opened this issue 7 years ago • 5 comments

Is it possible to highlight classes names and methods names?

no_name___-_vim2

harg avatar Aug 22 '17 14:08 harg

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.

leafgarland avatar Aug 23 '17 02:08 leafgarland

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

Zabanaa avatar Aug 27 '17 21:08 Zabanaa

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.

leafgarland avatar Aug 28 '17 05:08 leafgarland

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

harg avatar Aug 30 '17 19:08 harg

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.

tommyc38 avatar Nov 10 '20 04:11 tommyc38