Skip to content
G. Bai edited this page Mar 6, 2021 · 10 revisions

I use Vim to edit and compile LaTeX files, with the help of vimtex and UltiSnips plugins.

vimtex

Show state indicator in vim-airline

Here's the help for airline-vimtex:

-------------------------------------                      *airline-vimtex*
vimtex <https://github.com/lervag/vimtex>

Shows the current file's vimtex related info.

* enable/disable vimtex integration >
  let g:airline#extensions#vimtex#enabled = 1
<
* left and right delimiters (shown only when status string is not empty) >
  let g:airline#extensions#vimtex#left = "{"
  let g:airline#extensions#vimtex#right = "}"

State indicators:

* the current tex file is the main project file
  (nothing is shown by default) >
  let g:airline#extensions#vimtex#main = ""

* the current tex file is a subfile of the project
  and the compilation is set for the main file >
  let g:airline#extensions#vimtex#sub_main = "m"

* the current tex file is a subfile of the project
  and the compilation is set for this subfile >
  let g:airline#extensions#vimtex#sub_local = "l"

* single compilation is running >
  let g:airline#extensions#vimtex#compiled = "c₁"

* continuous compilation is running >
  let g:airline#extensions#vimtex#continuous = "c"

* viewer is opened >
  let g:airline#extensions#vimtex#viewer = "v"

My setting is here.

UltiSnips

I use Honza's vim-snippets/UltiSnips/tex.snippets and vim-snippets/snippets/tex.snippets for basic snippets compeletion, which is configured in my vimrc (when there are snippets using the same keywords, the former overrides the latter). I also maintain a personal tex.snippets for my own use.

Clone this wiki locally