peitalin / vim-jsx-typescript

React JSX syntax highlighting for vim and Typescript
The Unlicense
306 stars 29 forks source link

provide tsxCloseTagName #22

Closed quoininc-huudatran closed 4 years ago

quoininc-huudatran commented 4 years ago

Hi,

I'm not a TS/TSX coder, but I had to open one file and saw that the syntax highlighting wasn't that great. I think it would be useful to add a specific syntax for a new tsxCloseTagName (to make parallel with tsxTagName) so that we can highlight it.

Here's what I fiddle with from tsxTagName:

syntax match tsxCloseTagName
    \ +[</]\@<=[^ /!?<>"']\++
    \ containedin=tsxCloseTag
    \ display

I can then use

highlight tsxTagName guifg=#e06c75
highlight tsxCloseTag guifg=#00ffff
highlight tsxCloseTagName guifg=#e06c75

I think this could be useful for other people, obviously, we will not start a debate for color selection :)

Thanks,

quoininc-huudatran commented 4 years ago

This is kind of related to #12, but with a solution.

peitalin commented 4 years ago

Looks good to me, thanks for the contribution!

sartegbolt commented 4 years ago

This is kind of related to #12, but with a solution.

Sorry, how do I set the closing tag to have the same colour as the opening tag? I am using gruvbox theme and didn't want to change the colours