Vim & Neovim Integration with latex_it

latex_it provides first-class support for Vi, Vim, and Neovim through the standard --compile flag and the bundled Vim compiler plugin.


Quick Start (Zero-Plugin)

You can use latex_it directly with Vim’s built-in :make command without installing any plugins.

In your ~/.vim/after/ftplugin/tex.vim (or ~/.config/nvim/after/ftplugin/tex.lua):

Vimscript (~/.vim/after/ftplugin/tex.vim):

setlocal makeprg=l\ --compile
setlocal errorformat=%f:%l:%c:\ %t%*[^:]:\ %m,%f:%l:\ %t%*[^:]:\ %m,%f:%l:\ %m,%-G%.%#

Lua (~/.config/nvim/after/ftplugin/tex.lua):

vim.opt_local.makeprg = "l --compile"
vim.opt_local.errorformat = "%f:%l:%c: %t%*[^:]: %m,%f:%l: %t%*[^:]: %m,%f:%l: %m,%-G%.%#"

Whenever you run :make inside a .tex file:


Compiler Plugin (compiler/latex_it.vim)

The repository includes a standard Vim compiler script at compiler/latex_it.vim.

Installation:

Copy or symlink compiler/latex_it.vim into your Vim/Neovim compiler directory:

# Classic Vim
mkdir -p ~/.vim/compiler
cp compiler/latex_it.vim ~/.vim/compiler/

# Neovim
mkdir -p ~/.config/nvim/compiler
cp compiler/latex_it.vim ~/.config/nvim/compiler/

(If you use a plugin manager like vim-plug, lazy.nvim, or packer pointing to this repo, compiler/latex_it.vim is detected automatically).

Usage:

In any LaTeX buffer:

:compiler latex_it
:make

Asynchronous Building

With tpope/vim-dispatch:

:compiler latex_it
:Make

Compiles in the background without freezing your editor and loads errors into Quickfix when finished.

With skywind3000/asynrun.vim:

:AsyncRun -program=make l --compile

VimTeX Integration

If you use VimTeX, configure it to use l and recognize junk/ as the build directory:

let g:vimtex_compiler_method = 'generic'
let g:vimtex_compiler_generic = {
      \ 'command' : 'l --compile',
      \ }
let g:vimtex_build_dir = 'junk'

Classic Vi & POSIX vi

In traditional vi or nvi where Quickfix lists are not present, simply run:

:!l

latex_it executes directly in a subshell, outputting its clean diagnostic summary before returning to the editor buffer.