2

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

3

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
  • 1
    Many thanks, Karl! Congratulations for the great plugin and thanks for your patience :) – danilofreire Oct 22 '18 at 8:59
1

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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