Bad initialization: "set conceallevel"
Loading syntax/json.vim currently loads ftplugin/json.vim, which sets conceallevel. This is IMHO bad practise. For instance, if you load nested syntax in Markdown, LaTeX or similar, it should not affect the current filetype settings.
I noticed this:
https://github.com/elzr/vim-json/blob/3727f089410e23ae113be6222e8a08dd2613ecf2/syntax/json.vim#L6-L8
Thus, #42 concluded that runtime! ftplugin/json.vim is necessary, but I propose it is not. Instead, you should replace the use of the option g:vim_json_syntax_conceal with get(g:, 'vim_json_syntax_conceal', 1) (or 0, if that's the default). Or, use a plugin/json.vim to set default values for the options. Or an autoload function. Whatever, but don't load ftplugin/json.vim.
I notice that the repo seems relatively unmaintained, but I hope it might be possible to fix this regardless.
I'm looking to try this module. What did you put in your .vimrc to load this plugin?
I ran into this same issue today. I sent PR #108 to hopefully fix this properly, which guards with exists() expressions based on how vim's builtin json plugin works:
https://github.com/vim/vim/blob/5f1b115afd92544ce64d563da0d8ee9844abb10a/runtime/syntax/json.vim#L34
In case the PR doesn't merge, here are some workarounds I figured out today:
- In my case, the bug only repros if I have
let g:markdown_fenced_languages = [ 'json', ... ]in my vimrc. Removingjsonfrom the list fixes the issue and lets markdown files render properly again. json files will still haveconceallevel=2, as configured by theftpluginscript in this plugin. - If you can't live without
g:markdown_fenced_languages, then an autocmd seems to also do the trick:autocmd BufNewfile,BufReadPost *.md setlocal conceallevel=0 - If that doesn't work, you can explicitly set
let g:vim_json_syntax_conceal = 0but then you won't get concealing in json files anymore.