elzr / vim-json

A better JSON for Vim: distinct highlighting of keywords vs values, JSON-specific (non-JS) warnings, quote concealing. Pathogen-friendly.
Other
1.23k stars 111 forks source link

Use Boolean and Number highlights for jsonBoolean and jsonNumber #76

Closed rhysd closed 7 years ago

rhysd commented 7 years ago

Currently they're highlighted as Delimiter. But there are Boolean and Number for boolean values and numbers by default. If there is no special reason, vim-json should use them.

Official syntax/json.vim does it.

https://github.com/vim/vim/blob/master/runtime/syntax/json.vim

elzr commented 7 years ago

There was no special reason, thanks!

csaar95 commented 6 years ago

There was a special reason: #37 Would be nice, if this commit could be reverted.

ctranstrum commented 5 years ago

While updating the syntax file to set numbers and bools to Delimiter is a solution that works for non-differentiating colorschemes, it feels a tiny bit hacky to me, and a more correct solution, albeit one that relies on end-user configuration, seems to be simply to update either your colorscheme or your .vimrc to color String, Number, and Boolean differently.

For example, add something like this to ~/.vimrc:

highlight String ctermfg=green
highlight Number ctermfg=blue
highlight Boolean ctermfg=magenta

Maybe it would be a good idea if a troubleshooting tip along these lines could be added to the documentation.

rhysd commented 5 years ago

Since it's depending on colorscheme that string literal and number are highlighted in different colors, the documentation how to customize colors would be great. Many colorschemes highlight them in different colors, so current default values would be fine for most cases.