ProblemI find the error highlighting really distracting, its not that I don't want it because it is really useful for spotting errors in JSON syntax, but, I really dislike that it highlights new strings I start typing as errors. Obviously, if I have just started typing it out it won't be syntactically correct. It also knocks my workflow confidence.
Possible solutions in order of difficulty (and elegance)
- Disable JSON error highlighting
- Map a key to toggle JSON highlighting on/off
- Disable JSON highlighting on the current line only if the current line has just been added (
My attempt (solution 1)According to the syntax.txt file:
To disable syntax highlighting of errors: let g:vim_json_warnings = 0
I did this while in a JSON file but alas to no effect.
I also ran
:echo g:vim_json_warnings in a new vim instance and got
E121: Undefined variable: g:vim_json_warnings, which seemed a bit strange to me.
Am I doing something wrong or is this a bug? I am using vim 8.2 gui