0

I want to set let g:tex_conceal="" to disable mathematical symbols appearing instead of original text in a .tex file (as described here) in my .vimrc.

This setting is not working if I do it inside a function like

function! New_function()
    let g:tex_conceal=""
endfunction
autocmd BufReadPost,BufNewFile *.tex, call New_function()

Why is it not working? Other things I do inside a function are working correctly except this.

Also, these math symbols do not expand even if the cursor is over them in both normal and insert mode.

I am not using any latex related plugins.

  • You need to just set the variable globally. Trying to do it in a function doesnt make sense – D. Ben Knoble Apr 15 '20 at 12:55
  • Yes globally setting it works. But I want to know why does it not work here. Other variables work just fine. Is there any reason that I am not aware of? – kvng vikram Apr 16 '20 at 18:10
  • My guess is it’s too late: the syntax with conceal has probably been setup before you changed the variable. You could try bufreadpre, but the function changes the same variable every time, so just got with a single let in your vimrc and be done with it – D. Ben Knoble Apr 16 '20 at 18:11

0 Answers0