How can I adjust my .vimrc so that set conceallevel=0 is specific to just LaTeX documents?

The plugin vim-devicons requires the following conceal level with NERDTree:

set conceallevel=3

However, with this level set to 3, when editing a LaTeX document the LaTeX code is hidden and its WYSIWYG form is shown instead.

For example, instead of this showing in Vim:

\textbf{Leading Word:} This is a sentence.

...this is shown in Vim instead:

Leading Word: This is a sentence.

It's quite annoying to say the least because I would rather see the code, (or at least have the code revealed with the cursor placed over the text if there's no solution to see just the code with a conceallevel=3).

Setting set conceallevel=0 in my .vimrc has no effect on the LaTeX document and it continues the WYSIWYG behavior. Setting in vim set conceallevel=0 is cumbersome to do by hand in my workflow, and all the icons have special characters and brackets surrounding them.

1 Answer 1


I found the answer to my own question after hours of hunting.

This post sheds light on the issue: https://stackoverflow.com/questions/18160953/disable-latex-symbol-conversion-in-vim

It's resolved by:

let g:tex_conceal=""

To quote h: tex_conceal:

              *g:tex_conceal*  Tex: Selective Conceal Mode~

You may selectively use conceal mode by setting g:tex_conceal in your <.vimrc>. By default, g:tex_conceal is set to "admgs" to enable concealment for the following sets of characters: >

a = accents/ligatures b = bold and italic d = delimiters m = math symbols g = Greek s = superscripts/subscripts < By leaving one or more of these out, the associated conceal-character substitution will not be made.

Setting this to blank will reveal all the characters hidden specifically for TeX documents.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.