Find file
Fetching contributors…
Cannot retrieve contributors at this time
98 lines (74 sloc) 2.83 KB
*textobj-latex.txt* Text objects for LaTeX code *textobj-latex*
Author: Roberto Bonvallet <>
License: Same terms as Vim itself (see |license|)
INTRODUCTION *textobj-latex-introduction*
This plugin provides text objects for common LaTeX stuff that are not
conveniently described by builtin Vim |text-objects|.
INSTALLATION *textobj-latex-installation*
- Vim 7.0 or later
- Kana's |textobj-user| plugin, available at
If you use |Vundle|, add the following lines to your |vimrc|:
Bundle 'kana/vim-textobj-user'
Bundle 'rbonvall/vim-textobj-latex'
and then run |:BundleInstall| from within |Vim|.
If you use |Pathogen|, clone both repos in your bundle directory:
cd ~/.vim/bundle
git clone git://
git clone git://
If you don't use either: you should.
I have included dependency information for Vim Addon Manager and Vim Flavor,
but have made no effort whatsoever to test if they work properly.
LATEX TEXT OBJECTS *textobj-latex-text-objects*
Currently supported text objects come in pairs. The a-textobjs include its
delimiters, while the i-textobjs don't, just like many of the builtin Vim
text objects.
a\ *textobj-latex-a\*
i\ *textobj-latex-i\*
Text objects for inline math surrounded by \( and \).
a$ *textobj-latex-a$*
i$ *textobj-latex-i$*
Text objects for inline math surrounded by dollar
aq *textobj-latex-aq*
iq *textobj-latex-iq*
Text objects for single-quoted text `like this'.
aQ *textobj-latex-aQ*
iQ *textobj-latex-iQ*
Text objects for double-quoted text ``like this''.
ae *textobj-latex-ae*
ie *textobj-latex-ie*
Text objects for LaTeX environments.
Text objects for environments assume that both the
\begin{...} and \end{...} delimiters are on lines on
their own. By following this simple convention it is
much easier to support environments that accept
The leading whitespace of the first line after
\begin{...} is not included in the "ie" text object.
This allows to retain the indentation when deleting or
changing the content of the environment.
For example, if '█' represents the position of the
Before After typing "cie" ~
-------------------- -------------------- ~
\begin{document} \begin{document}
Theorem: Theorem:
\begin{equation} \begin{equation}
x^2 + █
y^2 =█ \end{equation}
z^2. \end{document}
-------------------- -------------------- ~