4

When I add \textbf{} or \textit{} before a word in vimtex the terminal shows the word but strangely hides the commands. I can only see them in the visual mode (see pictures below). Is there a way to force vim to always show \emph{} before the text?

I'm using Vim 8.1 on iTerm2 with the gruvbox theme if that's helpful.

This is what vimtex shows in insert/normal mode

This is what I see in visual mode

6

This is not due to vimtex directly, but due to the conceal feature in Vim. vimtex only adds to the syntax plugin that ships with Vim/neovim, and it adhers to the relevant option, see :help g:tex_conceal.

For direct control of the conceal feature itself, see :help conceallevel, :help concealcursor and :help syn-conceal.


Short answer, you can put the following in your vimrc file:

" To prevent conceal in LaTeX files
let g:tex_conceal = ''

" To prevent conceal in any file
set conceallevel = 0
| improve this answer | |
  • 1
    Many thanks, Karl! Congratulations for the great plugin and thanks for your patience :) – danilofreire Oct 22 '18 at 8:59
2

I think would be useful a "Toggle" mapping that allows us to swich concealling level:

nnoremap <Leader>c :let &cole=(&cole == 2) ? 0 : 2 <bar> echo 'conceallevel ' . &cole <CR>
| improve this answer | |

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