I noticed that when I load a markdown file in vim, the vim-json file automatically runs set conceallevel=2. There's a few configs which are necessary to reproduce this:
vimrc should have let g:markdown_fenced_languages = [ 'json', ... ]
Install elzr/vim-json plugin
Load any markdown file
When these conditions are met, the markdown plugin will load the vim-json/syntax/json.vim script. The problem is that this script does something unusual by also loading the corresponding ftplugin script. Since loading the ftplugin script is the root cause, the fix is to stop loading this script. Because the g:vim_json_syntax_conceal plugin might be uninitialized now, this guards the references with exists() expressions. This is the same pattern as used in the builtin json syntax plugin (vim/runtime/syntax/json.vim).
I tested this with:
set conceallevel=2 | let g:vim_json_syntax_conceal = 0
set conceallevel=0 | let g:vim_json_syntax_conceal = 1
I noticed that when I load a markdown file in vim, the
vim-json
file automatically runsset conceallevel=2
. There's a few configs which are necessary to reproduce this:let g:markdown_fenced_languages = [ 'json', ... ]
elzr/vim-json
pluginWhen these conditions are met, the markdown plugin will load the
vim-json/syntax/json.vim
script. The problem is that this script does something unusual by also loading the correspondingftplugin
script. Since loading theftplugin
script is the root cause, the fix is to stop loading this script. Because theg:vim_json_syntax_conceal
plugin might be uninitialized now, this guards the references withexists()
expressions. This is the same pattern as used in the builtin json syntax plugin (vim/runtime/syntax/json.vim
).I tested this with:
set conceallevel=2 | let g:vim_json_syntax_conceal = 0
set conceallevel=0 | let g:vim_json_syntax_conceal = 1
Fixes #104