I have a validated json file that will display without any quotes in Vim. The only time it displays the json file correctly is under Visual mode.
I have tried disabling eslint, jshint, youcompleteme
OS X MacVim 7.4 Vim 7.4 in Terminal
The built-in $VIMRUNTIME/syntax/json.vim
uses Vim's conceal feature to hide the quotes, presumably to remove unnecessary clutter.
You must have enabled concealing by setting the 'conceallevel'
option to 2
or 3
; the default is 0
(off). Likewise, you see the quotes in visual mode because of your 'concealcursor'
setting.
Inside a JSON file, check where the conceal options got set:
:verbose set conceallevel? concealcursor?
Then, you can adapt your settings to suit your preferences.
Adding to the currently accepted answer, you can disable that behavior specifically for JSON by setting the following option in you .vimrc
:
" Disable quote concealing in JSON files
let g:vim_json_conceal=0
That way, you don't have to set conceallevel
to 0 (disabled), which would also make useful plugins like indentLine (which was mentioned in a comment above) not work anymore.
Like already mentioned, one can check which plugin caused the increased conceal level:
:verbose set conceallevel?
If the conceal level is caused by the vim-json Plugin:
let g:vim_json_syntax_conceal = 0
If conceal is caused by the indentLine Plugin:
let g:indentLine_setConceal = 0
In vimrc, You can add both options for json files:
autocmd Filetype json
\ let g:indentLine_setConceal = 0 |
\ let g:vim_json_syntax_conceal = 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With