Skip to content

Bad initialization: "set conceallevel" #104

Description

@lervag

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:

" Reload the definition of g:vim_json_syntax_conceal
" see https://github.com/elzr/vim-json/issues/42
runtime! ftplugin/json.vim

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions