After finished setup neovim for Python, here are the tools/software that we need to setup neovim for LaTex:

You can more information on neovim installation and neovim plugin manager (vim-plug) in the previous post setup neovim for Python.

First, we add the following three plugins into our configuration file (init.vim) in our “plugin list“.

Then we can close and reopen our neovim, run :PlugInstall to install the above three plugins.

## python package for pdf compilation auto refresh

In order to let our LaTex plugin vimtex refresh compiled pdf in real time, we need to install one python package:

pip install neovim-remote

In addition, if you use Adobe Reader as your pdf viewer the real time refresh will report error since Adobe Reader will put a lock on the pdf file.

## Vimtex Plugin settings

After we have the plugins installed, let’s paste the following settings for vimtex into our configuration file (init.vim)

Since we used ncm2 as our completion plugin for vim, here is setting that we need to register LaTex code completion source for ncm2

## Vimtex In Action

Now suppose we have a simple .tex file showing below

And here are the commands that we would use

• VimtexCompile: Start compiling the LaTex Code (in continuous mode since we set it above)
• VimtexView: Open the compiled pdf using the
• VimtexErrors: Display errors (if any) in the current file

and we can see the real-time update as we write the file.