Reputation: 2676
I have vim, and like the Tex conceal option. Specifically, if I have let g:tex_conceal="sabgm"
in my ~/.vimrc
, whenever I type $\beta$
, I see β. But, after switching color themes, I get some weird output:
Upvotes: 6
Views: 2226
Reputation: 2676
As found here, you have to have hi Conceal guibg=White guifg=Black
(or similar) in your ~/.vimrc
.
edit 2020-07-19 I've since written a blog post titled "Vim syntax highlighting for Markdown, Liquid and MathJax." It walks through a method to provide Latex and Liquid highlighting for Jekyll. It's pretty easy to adapt for only Latex:
# eg inside .vimrc
function! MathHighlight()
"" Define certain regions
" Block math. Look for "$$[anything]$$"
syn region math start=/\$\$/ end=/\$\$/
" inline math. Look for "$[not $][anything]$"
syn match math_block '\$[^$].\{-}\$'
"" Actually highlight those regions.
hi link math Statement
hi link liquid Statement
hi link highlight_block Function
hi link math_block Function
endfunction
" Call everytime we open a Markdown file
autocmd BufRead,BufNewFile,BufEnter *.md,*.markdown call MathHighlight()
Upvotes: 4
Reputation: 202
Here's what worked for me.
Add hi clear Conceal
at the bottom of your .vimrc
.
Upvotes: 5