Open-source project
lervag/vimtex avatar
lervag/vimtex

VimTeX: LaTeX editing inside Vim and Neovim

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.

6,374 stars415 forksTeXMIT

At a glance

What is it?
VimTeX is a filetype and syntax plugin for LaTeX that wires compilation, PDF viewing and inverse search into Vim and Neovim. It is deliberately not a LaTeX distribution, and its 2026 requirements rule out older editors.
Who is it for?
Adopt VimTeX if you already edit LaTeX in Vim or Neovim and want compilation, viewing and inverse search handled by the editor you are in. Do not adopt it if you are on Vim older than 9.2 or Neovim older than 0.12.4, since the current release will not run there, and do not treat it as a replacement for a TeX distribution.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 5 days ago.
What is it written in?
Mainly TeX, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What VimTeX is, and who it is for

VimTeX is a filetype and syntax plugin for LaTeX files, written mostly in Vimscript and aimed at people who already write documents in Vim or Neovim. It does not ship a TeX engine. The TeX distribution, the compiler binary and the PDF viewer are separate installations; VimTeX is the layer that connects them to the editor buffer you are typing in.

The README describes it as "a modern Vim and neovim filetype plugin for LaTeX files". The word filetype matters. Because VimTeX loads through Vim's filetype mechanism and its own autoload directories, it is already lazy in the sense that it activates when a tex file is opened. That is why the installation notes warn against plugin-manager lazy loading: doing it anyway breaks inverse search, which depends on a global command, :VimtexInverseSearch.

This is a tool for a specific workflow. If you write LaTeX in a graphical editor and are happy there, VimTeX offers nothing you need. If you live in Vim and keep shelling out to compile a document, it removes that context switch.

How compilation, viewing and inverse search fit together

The mechanism is a compiler backend plus a viewer method plus a set of mappings. By default the compiler backend is latexmk, and the README says that if you use latexmk you probably need no compiler configuration at all. Other backends exist; the documentation lists them under :help vimtex-compiler, and the README's configuration sample shows latexrun as an alternative value for g:vimtex_compiler_method.

The viewer is configured separately, either by naming a built-in method such as zathura or by describing a general viewer command. The general form takes the viewer binary and an options string containing placeholders for the PDF file and the source line, which is what makes jumping from the PDF back to the correct line in the buffer possible.

Inverse search is the part with the sharpest constraint. It relies on a global command, so it is not scoped to a buffer or a filetype. Anything that prevents that command from being defined at the right time, including lazy loading through a plugin manager, breaks the round trip from PDF to source.

Installing VimTeX and compiling a first document

VimTeX requires Vim version 9.2 or Neovim version 0.12.4. The README states these requirements were updated in July 2026 after the release of VimTeX 2.18, and that anyone stuck on older versions should stay at the v2.17 tag or older rather than use the most recent version. Check your editor version before choosing an installation route.

On Neovim, the built-in plugin manager is vim.pack. Create a file such as ~/.config/nvim/plugin/vimtex.lua and add the plugin, then set configuration through the g: variable convention:

lua
vim.pack.add { "https://github.com/lervag/vimtex" }

vim.g.vimtex_view_method = "zathura"

With lazy.nvim, the README's plugin spec sets lazy to false and does configuration in an init function:

lua
{
  "lervag/vimtex",
  lazy = false,
  init = function()
    vim.g.vimtex_view_method = "zathura"
  end
}

With vim-plug, add one line to your configuration. The first uses the master branch, the second pins to a release tag:

vim
Plug 'lervag/vimtex'
Plug 'lervag/vimtex', { 'tag': 'v2.15' }

After installation, the README's configuration overview requires filetype and syntax handling to be on. Most plugin managers do this automatically, but it can be set explicitly:

vim
filetype plugin indent on
syntax enable

With latexmk installed, open a tex file and compile. The documentation covers the commands under :help vimtex-compiler, and the README points new users at the requirements section of doc/vimtex.txt for the external tools each feature needs. If compilation fails, the first thing to check is whether latexmk is on your PATH, since it is the default backend.

The version floor is the real adoption cost

The most consequential limitation is not a bug. It is the requirement change in v2.18. VimTeX now needs Vim 9.2 or Neovim 0.12.4, and the README is explicit that users on older editors should remain at v2.17 or older. That means a distribution-packaged Vim, or a Neovim from a stable channel that lags, can leave you choosing between an older VimTeX and a newer editor.

There is a second, subtler trap in the built-in package route. The README notes that Vim by default places custom /start/ plugin directories at the end of the runtimepath, so the built-in filetype plugin loads first and prevents VimTeX from loading. It links issue #1413 for suggested solutions and points at :scriptnames to see which scripts loaded and in what order. Helptags are also not generated automatically in that setup; you run :helptags yourself.

Finally, VimTeX is the wrong tool if your problem is TeX itself. It will not install a distribution, resolve missing packages or fix a broken bibliography. Those are outside its scope by design.

VimTeX versus a general LaTeX editing environment

The natural comparison is with an all-in-one LaTeX environment, whether that is a dedicated editor or a general editor with a LaTeX extension. The difference is where the integration lives. An all-in-one environment bundles or manages the toolchain for you: it knows how to find a compiler, it renders a preview pane, and the PDF viewer is part of the application. VimTeX assumes all of that already exists on your system and provides the bindings between the buffer, the compiler backend and the viewer.

That trade-off cuts both ways. VimTeX gives you the editor you already configured, with your existing keybindings, navigation and file handling, and it lets you choose the viewer and compiler backend independently. In exchange, you own the integration: latexmk or another backend must be installed, the viewer must be named or described, and inverse search has to be wired correctly.

A second comparison is with Vim's own built-in tex support. VimTeX is a filetype and syntax plugin that extends far past syntax highlighting, and the README's requirement that filetype and syntax handling be enabled shows it builds on that base rather than replacing it. The practical difference is the compilation and viewing layer, not the highlighting.

Maintenance, releases and licence

The repository is not archived, and the last push was on 2026-09-19. Releases are infrequent rather than continuous: v2.18 on 2026-07-22, v2.17 on 2025-10-04 and v2.16 on 2025-01-18. That cadence is worth knowing if you pin to tags. Pinning is supported, and the README shows tag pinning for both lazy.nvim and vim-plug, but a pinned tag also pins you to that tag's editor requirement. Staying on v2.17 to keep an older Vim means you do not receive whatever lands in later releases.

The repository ships a test suite driven from the root Makefile, which wraps the suite in test/. Running make runs the full suite, make test-toc runs a single test directory, and make test/test-toc/test-general runs a single test file. The Makefile also documents an override for running with vanilla Vim. That is useful if you want to check behaviour against your own editor build rather than trusting a release note.

VimTeX is MIT licensed. That is permissive and places few obligations on users who install it as a plugin, but the licence text in LICENSE.md is the authority, and this is not legal advice. The plugin depends on external tools such as latexmk, whose own licences are separate from VimTeX's.

Editorial conclusion

Adopt VimTeX if you already edit LaTeX in Vim or Neovim and want compilation, viewing and inverse search handled by the editor you are in. Do not adopt it if you are on Vim older than 9.2 or Neovim older than 0.12.4, since the current release will not run there, and do not treat it as a replacement for a TeX distribution. Before committing, verify that latexmk is present for the default compiler backend, that your chosen viewer is one of the built-in methods or is described by a general viewer command, and that your plugin manager is not set to lazy load VimTeX, because that breaks inverse search.

Frequently asked questions

What does VimTeX do?

It is a Vim and Neovim filetype and syntax plugin for LaTeX files. It connects the editor to a compiler backend and a PDF viewer, including inverse search from the PDF back to the source line.

How do I install VimTeX?

The README gives routes for vim.pack on Neovim, lazy.nvim and vim-plug, plus a note on the built-in package feature. Whichever you use, do not lazy load it through the plugin manager, because that breaks inverse search.

How do I set up VimTeX?

Configuration uses vimscript variables such as g:vimtex_view_method and g:vimtex_compiler_method, set in your .vimrc, init.vim or Neovim Lua config. The README also requires filetype and syntax handling to be enabled, which most plugin managers do automatically.

Can I use Vim with LaTeX?

Yes. VimTeX is built for that, and the default compiler backend is latexmk, with other backends listed in the documentation under :help vimtex-compiler.

Official sources

  1. lervag/vimtex on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/lervag-vimtex.svg)](https://hysenlabs.com/projects/lervag-vimtex)