/tex-conceal.vim

Primary LanguageVim ScriptMIT LicenseMIT

tex-conceal.vim

A vim plugin extends the Conceal feature for LaTeX.

Without conceal

With conceal

With conceal and this plugin

Output

Installation

Plugin 'KeitaNakamura/tex-conceal.vim'                 " for Vundle
Plug   'KeitaNakamura/tex-conceal.vim', {'for': 'tex'} " for VimPlug

For vimtex user

vimtex started using its own conceal feature from v2. Those changes break this plugin for now. So you should choose vimtex v2 or the latest version v1.6 that tex-conceal works.

Plug 'lervag/vimtex', {'tag': 'v1.6'}

Options

Super/sub-scrips

To avoid having inscrutable utf-8 glyphs appear, set g:tex_superscripts and g:tex_subscripts:

let g:tex_superscripts= "[0-9a-zA-W.,:;+-<>/()=]"
let g:tex_subscripts= "[0-9aehijklmnoprstuvx,+-/().]"

See :h tex-conceal in more detail.

Fraction

To conceal fraction (½⅓⅔¼⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞)

let g:tex_conceal_frac=1

Recommended settings

set conceallevel=2
let g:tex_conceal="abdgm"