This page contains animated GIFs that demonstrate many of the core VimTeX
editing features listed in :help vimtex-features
. The related mappings are
documented in detail at :help vimtex-mappings
. The GIFs and accompanying
descriptions are used with permission from
@ejmastnak's guide to Getting started with the
VimTeX plugin.
Hopefully, the animations can give you a clearer mental image of what VimTeX's
mappings do and how you might use them. You may want to scroll through this page
while simultaneously looking through :help vimtex-features
—the animations
should nicely complement the plain-text documentation.
-
This page is made possible only with help from the community. @ejmastnak, not @lervag, takes primary responsibility for maintaining it, but contributions from all VimTeX users are welcome.
-
If you notice mistakes or outdated content (following a VimTeX update, say), feel free to open a PR to fix it yourself. Alternatively, contact @ejmastnak at ejmastnak@gmail.com, who will be happy to help fix it.
- Motion commands
- Text objects
- Deleting surrounding LaTeX content
- Changing surrounding LaTeX content
- Toggling commands
Use ]]
to jump to the beginning of the next \section
, \subsection
or
\subsubsection
, whichever comes first. Use [[
to jump backward through
sections, and see the similar shortcuts ][
and []
in the VimTeX
documentation at :help <Plug>(vimtex-][)
and :help <Plug>(vimtex-[])
.
Use ]m
and [m
to jump to the next or previous environment \begin{}
command. See the VimTeX documentation for the similar shortcuts ]M
and [M
,
described in :help <Plug>(vimtex-]M)
and :help <Plug>(vimtex-[M)
.
Use ]n
and [n
to jump to the beginning of the next or previous math zone.
See the VimTeX documentation for the similar shortcuts ]N
and [N
,
described in :help <Plug>(vimtex-]N)
and :help <Plug>(vimtex-[N)
.
Use ]r
and [r
to jump to the beginning of the next or previous Beamer
frame
environment. See the VimTeX documentation for the similar shortcuts
]R
and [R
, described in :help <Plug>(vimtex-]R)
and :help <Plug>(vimtex-[R)
.
Use %
to move between matching delimiters, inline-math $
delimiters, and LaTeX environments.
VimTeX provides text objects for commands, delimiters, environments, math zones, sections, and items. The following GIFs use Vim's visual mode to show the scope of the text objects.
The i$
and a$
text objects select inline math, display math, and
common math environments.
The iP
and aP
text objects select LaTeX sections (their
subsection variations); the id
and ad
objects select delimiters
(parentheses, brackets, braces...); the ic
and ac
objects select
LaTeX commands.
The ie
and ae
text objects select LaTeX environments and the im
and am
objects select items in enumerated environments.
Use dsc
to delete a LaTeX command while preserving the command's argument(s);
the dsc
mapping also recognizes and correctly deletes parameters inside square
brackets.
Use dse
to delete the \begin{}
and \end{}
declaration surrounding a LaTeX
environment without changing the environment contents.
Use ds$
to delete surrounding math zones (display math, standard environments,
and inline math) without changing the math contents.
Use dsd
to delete delimiters (e.g. ()
, []
, {}
, and any of their \left \right
, \big \big
variants) without changing the enclosed content.
Use csc
to change a LaTeX command while preserving the command's argument(s).
Use cse
to change the type of a LaTeX environment without changing the
environment contents.
Use cs$
to change the type of surrounding math zone without changing the math
contents. You can switch between display math, standard environments, and inline
math.
Use csd
to change delimiters (e.g. ()
, []
, {}
, and any of their \left \right
, \big \big
variants) without changing the enclosed content; the csd
command is "smart" and correctly recognizes and preserves \left \right
-style
modifiers.
Use tsc
and tse
to toggle between starred and un-starred versions of
commands and environments, respectively.
Use ts$
to toggle between inline math, display math, and standard math environments.
Use tsd
to change between plain and \left
/\right
versions of delimiters.
Use the g:vimtex_delim_toggle_mod_list
variable to add more modifiers to the
delimiter toggle list. (e.g. \big
as in the GIF below)
Use tsf
to toggle between inline and \frac{}{}
versions of fractions.