Go to file
kiryph 9c91576f52 Extend #571: Fold cmds following 3 patterns
with options to assign commands to these patterns
2016-10-25 20:39:00 +02:00
after/syntax Fixed #554: Wrong syntax highlighting of \cite[pt] 2016-09-14 23:02:57 +02:00
autoload Extend #571: Fold cmds following 3 patterns 2016-10-25 20:39:00 +02:00
compiler Fix #545: Handle more warning messages 2016-09-10 22:53:45 +02:00
doc Update docs for extended cmd folding 2016-10-25 20:39:00 +02:00
ftplugin Fix #540: Support comments in bib files 2016-09-10 23:14:25 +02:00
indent Fixup indent code syntax 2016-10-13 10:01:51 +02:00
media Another try 2016-09-30 22:28:14 +02:00
test Fix #548: Also handle multi-line short titles 2016-10-21 09:17:19 +02:00
.gitignore Ignore extra files for tests 2014-06-10 20:02:15 +02:00
.travis.yml Use different ppa for vim 2016-04-08 22:55:12 +02:00
CONTRIBUTING.md Updated CONTRIBUTING.md with comment on help writing 2016-04-11 17:52:21 +02:00
ISSUE_TEMPLATE.md Also mention .latexmkrc files in issue template 2016-04-09 22:32:15 +02:00
LICENSE.md Moved license to separate file 2016-09-22 08:38:51 +02:00
README.md Remove redundant information 2016-09-30 22:04:58 +02:00

vimtex

vimtex is a Vim plugin that provides support for writing LaTeX documents. It is based on LaTeX-Box and it shares a similar goal: to provide a simple and lightweight LaTeX plugin. It has been rewritten from scratch to provide a more modern and modular code base. See here for some more comments on the difference between vimtex and other LaTeX plugins for Vim.

Build Status Donate

Installation

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

Plug 'lervag/vimtex'

Or use some other plugin manager:

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 here or :h vimtex).

Quick start gif

Features

Below is a list of features offered by vimtex. The features are accessible as both commands and mappings. The mappings generally start with <localleader>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
  • Compilation of selected part of document
  • Support for several PDF viewers with forward search
  • Completion of citations, labels, and file names for figures
  • Document navigation through
    • table of content
    • table of labels
  • Word count (through texcount)
  • Motions
    • Move between sections with [[, [], ][, ]]
    • Move between matching delimiters with %
  • Text objects
    • ic ac Commands
    • id ad Delimiters
    • ie ae LaTeX environments
    • i$ a$ Inline math structures
  • Other mappings
    • Delete the surrounding command or environment with dsc/dse/ds$
    • Change the surrounding command or environment with csc/cse/cs$
    • Toggle starred environment with tse
    • Toggle between e.g. () and \left(\right) with tsd
    • Close the current environment/delimiter in insert mode with ]]
    • Insert new command with <F7>
    • Convenient insert mode mappings for faster typing of e.g. maths
  • Improved folding (:h 'foldexpr')
  • Improved indentation (:h 'indentexpr')
  • Improved syntax highlighting
    • Highlight matching delimiters
    • Support for biblatex/natbib package
    • Support for cleveref package
    • Support for listings package
    • Support for minted package
    • Support for dot2tex with nested syntax highlighting
  • Support for multi-file project packages

See the documentation for a thorough introduction to vimtex (e.g. :h vimtex).

Alternatives

The following are some alternative LaTeX plugins for Vim:

  • 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).

    Note: LaTeX-Box is included with vim-polyglot. Some users are not quite aware of this and end up trying vimtex with LaTeX-Box enabled. This will not work --- please disable LaTeX-Box first!

  • 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 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.
  • AutomaticTexPlugin

  • vim-latex-live-preview

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