Skip to content

set g:vim_json_syntax_conceal = 0 in insert mode #23

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
davidchambers opened this issue Dec 12, 2013 · 4 comments
Closed

set g:vim_json_syntax_conceal = 0 in insert mode #23

davidchambers opened this issue Dec 12, 2013 · 4 comments

Comments

@davidchambers
Copy link

Is it possible to disable concealing entirely when entering insert mode? If so, how? I played around with autocmd in my .vimrc but couldn't figure it out.

The InsertEnter and InsertLeave hooks might be helpful.

@darvelo
Copy link

darvelo commented Apr 8, 2014

This is working for me in my vimrc:

autocmd InsertEnter *.json setlocal conceallevel=2 concealcursor=
autocmd InsertLeave *.json setlocal conceallevel=2 concealcursor=inc

You can probably do away with the conceallevel=2 parts to leave that variable as it was. Check to make sure.

I'm using the indentLine plugin which, since it uses an after/plugin file structure, would normally override any conceal config in vimrc.

@elzr
Copy link
Owner

elzr commented Apr 12, 2014

This is one messy interaction that is kind of inherent to the overeager indentLineplugin (I'm guessing @davidchambers also had it installed and the problem has happened before). To try to preserve the illusion at all times of their indenting vertical-lines they go too far and disallow disabling concealing in any mode.

I think the best solution if you're using indentLine is to do

let g:indentLine_noConcealCursor=""

in your .vimrc (that is, set it to empty). This will allow you to see the concealed javascript punctuation in the current cursor line when in normal & indent mode as intended.

(An intermediate step could be let g:indentLine_noConcealCursor="nc" which would enable vim-json only when actually in indent mode.)

The code that @appleYaks gives also works (no need for the conceallevel=2 part).

@elzr elzr closed this as completed Apr 12, 2014
@darvelo
Copy link

darvelo commented Apr 13, 2014

@elzr thanks for researching this!

@Break-Neck
Copy link

let g:indentLine_noConcealCursor=""

Thanks for your explanation, it worked with a different string for me: let g:indentLine_concealcursor=""

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants