Need help with vimtex?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

lervag
3.2K Stars 292 Forks MIT License 3.9K Commits 25 Opened issues

Description

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

Services available

!
?

Need anything else?

Contributors list

# 17,428
vim-plu...
Vim
TeX
LaTeX
3187 commits
# 99,554
vim-scr...
viml
repl
TeX
44 commits
# 235,768
Vim
TeX
Perl
LaTeX
20 commits
# 241,187
Vim
TeX
Perl
LaTeX
19 commits
# 58,473
Vim
TeX
Neovim
Lua
18 commits
# 44,931
nix
PureScr...
Neovim
viml
18 commits
# 257,034
The Jul...
hdf5
Vim
julia-l...
15 commits
# 46,442
Neovim
Vim
The Jul...
Lua
15 commits
# 233,362
ncurses
C++
TeX
Zsh
14 commits
# 255,148
TeX
Vim
C++
particl...
11 commits
# 267,595
Vim
TeX
LaTeX
vim-plu...
11 commits
# 296,999
Vim
TeX
Perl
LaTeX
10 commits
# 264,710
Vim
TeX
gruvbox
Neovim
8 commits
# 316,818
Vim
TeX
Perl
LaTeX
8 commits
# 339,068
Vim
TeX
LaTeX
vim-plu...
6 commits
# 276,890
C
forge
TeX
LaTeX
6 commits
# 3,185
Python
Vim
code-an...
code-co...
6 commits
# 262,787
Vim
TeX
C++
documen...
6 commits
# 76,486
panoram...
prose
Markdow...
Vim
4 commits
# 379,090
C++
Vim
TeX
LaTeX
4 commits

VimTeX

VimTeX is a modern Vim and Neovim filetype and syntax plugin for LaTeX files.

Gitter CI tests Donate

Table of contents

Requirements

VimTeX requires Vim version 8.0.1453 or Neovim version 0.4.3. The requirements were updated in July 2020 after the release of VimTeX 1.0. If you are stuck on older versions of Vim or Neovim, then you should not use the most recent version of VimTeX, but instead remain at the v1.0 tag.

Some features require external tools. For example, the default compiler backend relies on latexmk. Users are encouraged to read the requirements section in the documentation (

:h vimtex-requirements
).

Installation

If you use vim-plug, then add the following line to your

vimrc
file:
Plug 'lervag/vimtex'

Or use some other plugin manager: * vundle * neobundle * pathogen

If you use the new package feature in Vim, please note the following: * Make sure to read and understand the package feature:

:help package
! * Use the
/pack/foo/start
subdirectory to make sure the filetype plugin is automatically loaded for the
tex
filetypes. * Helptags are not generated automatically. Run
:helptags
to generate them. * Please note that by default Vim puts custom
/start/
plugin directories at the end of the
&runtimepath
. This means the built in filetype plugin is loaded, which prevents VimTeX from loading. See #1413 for two suggested solutions to this. To see which scripts are loaded and in which order, use
:scriptnames
. * For more information on how to use the Vim native package solution, see here and here.

Quick Start

The following is a simple guide for how to use VimTeX. It only displays the most basic features. Users are strongly encouraged to read or at least skim through the documentation to learn about the different features and possibilities provided by VimTeX (see

:h vimtex
).

Quick start gif

Advanced users and potential developers may also be interested in reading the supplementary documents:

Features

Below is a list of features offered by VimTeX. The features are accessible as both commands and mappings. The mappings generally start with

l
, but if desired one can disable default mappings to define custom mappings. All features are enabled by default, but each feature may be disabled if desired.
  • Document compilation with latexmk, latexrun, tectonic, or arara
  • LaTeX log parsing for quickfix entries using
  • Compilation of selected part of document
  • Support for several PDF viewers with forward search
  • Completion of
    • citations
    • labels
    • commands
    • file names for figures, input/include, includepdf, includestandalone
    • glossary entries
    • package and documentclass names based on available
      .sty
      and
      .cls
      files
  • Document navigation through
    • table of content
    • table of labels
    • proper settings for
      'include'
      ,
      'includexpr'
      ,
      'suffixesadd'
      and
      'define'
      , which among other things
    • allow
      :h include-search
      and
      :h definition-search
    • give enhanced
      gf
      command
  • Easy access to (online) documentation of packages
  • Word count (through
    texcount
    )
  • Motions
    • Move between section boundaries with
      [[
      ,
      []
      ,
      ][
      , and
      ]]
    • Move between environment boundaries with
      [m
      ,
      [M
      ,
      ]m
      , and
      ]M
    • Move between math environment boundaries with
      [n
      ,
      [N
      ,
      ]n
      , and
      ]N
    • Move between frame environment boundaries with
      [r
      ,
      [R
      ,
      ]r
      , and
      ]R
    • Move between comment boundaries with
      [*
      and
      ]*
    • Move between matching delimiters with
      %
  • Text objects
    • ic ac
      Commands
    • id ad
      Delimiters
    • ie ae
      LaTeX environments
    • i$ a$
      Inline math structures
    • iP aP
      Sections
    • im am
      Items
  • Other mappings
    • Delete the surrounding command, environment or delimiter with
      dsc
      /
      dse
      /
      ds$
      /
      dsd
    • Change the surrounding command, environment or delimiter with
      csc
      /
      cse
      /
      cs$
      /
      csd
    • Toggle starred command or environment with
      tsc
      /
      tse
    • Toggle between e.g.
      ()
      and
      \left(\right)
      with
      tsd
    • Toggle (inline) fractions with
      tsf
    • Close the current environment/delimiter in insert mode with
      ]]
    • Insert new command with
      
      
    • Convenient insert mode mappings for faster typing of e.g. maths
    • Context menu on citations (e.g.
      \cite{...}
      ) mapped to
      
      
  • Improved folding (
    :h 'foldexpr'
    )
  • Improved indentation (
    :h 'indentexpr'
    )
  • Syntax highlighting
    • A consistent core syntax specification
    • General syntax highlighting for several popular LaTeX packages
    • Nested syntax highlighting for several popular LaTeX packages
    • Highlight matching delimiters
  • Support for multi-file project packages

See the documentation for a thorough introduction to VimTeX (e.g.

:h vimtex
).

Other relevant plugins

Even though VimTeX provides a lot of nice features for working with LaTeX documents, there are several features that are better served by other, dedicated plugins. For a more detailed listing of these, please see

:help
vimtex-non-features
.

Linting and syntax checking

Snippets and templates

Tag navigation

Alternatives

The following are some alternative LaTeX plugins for Vim:

  • LaTeX-Suite

    The main difference between VimTeX and LaTeX-Suite (aka vim-latex) is probably that VimTeX does not try to implement a full fledged IDE for LaTeX inside Vim. E.g.:

    • VimTeX does not provide a full snippet feature, because this is better handled by UltiSnips or neosnippet or similar snippet engines.
    • VimTeX builds upon Vim principles: It provides text objects for environments, inline math, it provides motions for sections and paragraphs
    • VimTeX uses
      latexmk
      ,
      latexrun
      ,
      tectonic
      or
      arara
      for compilation with a callback feature to get instant feedback on compilation errors
    • VimTeX is very modular: if you don't like a feature, you can turn it off.
  • LaTeX-Box

    VimTeX currently has most of the features of LaTeX-Box, as well as some additional ones. See here for a relatively complete list of features.

    One particular feature that LaTeX-Box has but VimTeX misses, is the ability to do single-shot compilation with callback. This functionality was removed because it adds a lot of complexity for relatively little gain (IMHO).

  • AutomaticTexPlugin

  • vim-latex-live-preview

For more alternatives and more information and discussions regarding LaTeX plugins for Vim, see:

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.