1
0
Fork
You've already forked vimtex
0
A modern vim plugin for editing LaTeX files.
  • TeX 87.3%
  • Vim Script 12.5%
  • Python 0.1%
Find a file
2018年12月17日 19:54:37 +02:00
after Fixed #1231 : Allow math constructs in texMatchNMGroup 2018年09月27日 21:04:12 +02:00
autoload Add viewer support for cygwin environments 2018年12月17日 19:54:37 +02:00
doc propose rapidee for changing %PATH% in Windows 2018年12月12日 23:12:11 +01:00
ftplugin Minor fix to bibinclude toc entries 2018年08月07日 23:59:53 +02:00
indent Make functions abort immediately when an error is raised 2018年11月04日 09:34:18 +01:00
media Another try 2016年09月30日 22:28:14 +02:00
rplugin/python3/denite/source Update unite/denite sources 2018年09月02日 11:27:04 +02:00
test Updated folding text (cf. #1274 ) 2018年12月07日 23:44:40 +01:00
.gitignore Ignore extra files for tests 2014年06月10日 20:02:15 +02:00
.travis.yml ... 2017年06月08日 21:56:38 +02:00
.vintrc.yaml Added vintrc file 2017年02月01日 13:23:44 +01:00
CONTRIBUTING.md Updated CONTRIBUTING.md with comment on help writing 2016年04月11日 17:52:21 +02:00
ISSUE_TEMPLATE.md Minor fix 2018年02月19日 08:42:35 +01:00
LICENSE.md Happy new years! 2018年01月01日 13:45:04 +01:00
README.md Minor update 2018年10月29日 11:25:52 +01: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

Table of contents

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

Note: Vimtex supports neovim; see the related wiki section or :h vimtex-faq-neovim.

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, latexrun, 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 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
  • 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
    • 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
    • Nested syntax highlighting (minted, dot2tex, lualatex, gnuplottex, asymptote, pythontex)
  • 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-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 latexrun or 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: