1

I've set conceallevel=0 in .vimrc, but the text is not shown normally after opening .tex file. I have to type it again while the file is open and it works.

From my .vimrc:

"vimtex config
set conceallevel=0
let g:tex_flavor='latex'
let g:vimtex_view_method='zathura'
let g:tex_conceal = ''
let g:vimtex_fold_manual = 1

1 Answers1

2

@statox, thank you! I've set two autocommands:

autocmd BufEnter *.tex set conceallevel=1
autocmd BufEnter *.tex set concealcursor=n

I've found this concealcursor feature, it seems useful to remove concealment of one line only when editing it. So I don't need set conceallevel=0.

I also removed let g:tex_conceal = '', looks like it doesn't work. Info from the new release of vimtex:

Vimtex no longer respects the "internal" options such as g:tex_fast and g:tex_conceal. For conceals, see :help g:vimtex_syntax_conceal.

Thanks again for not showing me the correct response, it forced me to search and learn more.

  • 1
    Did you check out :help g:vimtex_syntax_conceal? It looks to me that a simple let g:vimtex_syntax_conceal_default = 0 would work to disable conceal on TeX files with the new vimtex. Maybe try that? And it looks like the new option gives you a very granular control of what to display and what to conceal, in case you're interested in using some of the concealing syntax but not all... – filbranden May 02 '21 at 03:41
  • 1
    yes, setting let g:vimtex_syntax_conceal_default = 0 in vimrc solves the original problem; looks like it's a simpler solution. But now I prefer to keep only autocmd BufEnter *.tex set concealcursor=c. It removes concealment in the places where the cursor appears. It's very comfortable for me. I guess that setting g:vimtex_syntax_conceal_default in vimrc is not necessarily needed now because its default value works fine with the functionality of concealcursor. Anyways, many thanks! – Dominik Lenda May 02 '21 at 14:04