The vim modeline settings options words appear in selected in red in the first line :
# vim: set ft=json noet:
I'm using vim 7.4 on CentOS Linux 7.9.
How can I disable that ?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
JSON does not have any comments. Hence, the line is malformed and highlighted as an error.
You can disable this by setting
let g:vim_json_warnings = 0 before opening the file. However, an error still an error, and your JSON parser may not be happy about that.
P.S. So this also means that there's no good way to insert a modeline into arbitrary JSON file.