Setup Neovim for Latex
After finished setup neovim for Python, here are the tools/software that we need to setup neovim for LaTex:
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.
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.
After we have the plugins installed, let’s paste the following settings for
vimtex into our configuration file (
Since we used
ncm2 as our completion plugin for vim, here is setting that we need to register LaTex code completion source for
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.