othree / yajs.vim

YAJS.vim: Yet Another JavaScript Syntax for Vim
http://www.vim.org/scripts/script.php?script_id=4974
Vim License
688 stars 41 forks source link

Syntax for $ as key #174

Open ycmjason opened 5 years ago

ycmjason commented 5 years ago
fn({
  $a: 3
});

The $ will not be highlighted properly: image

Expected: image

Thanks for the good work!

othree commented 5 years ago

Hi, what is your Vim version? I use syntax iskeyword to do this now. It requires 7.4-1142

ycmjason commented 5 years ago

@othree Hi, I am currently using neovim. Perhaps the problem was with neovim?

othree commented 5 years ago

Sorry, I am not sure which version of nvim supports this feature. Can you try execute manually:

syn iskeyword @,48-57,_,192-255,$
ycmjason commented 5 years ago

I have tried it, confirming that it will work!

othree commented 5 years ago

What do you mean work. The highlight works after you execute the command?

ycmjason commented 5 years ago

@othree

Yes. After running your suggested command: syn iskeyword @,48-57,_,192-255,$ the highlight is correct.