Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

98 lines (74 sloc) 2.9 kb
*textobj-latex.txt* Text objects for LaTeX code *textobj-latex*
Author: Roberto Bonvallet <rbonvall@gmail.com>
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*
Requirements:
- Vim 7.0 or later
- Kana's |textobj-user| plugin, available at
https://github.com/kana/vim-textobj-user
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://github.com/kana/vim-textobj-user
git clone git://github.com/rbonvall/vim-textobj-latex
<
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.
*textobj-latex-paren-equation*
a\ *textobj-latex-a\*
i\ *textobj-latex-i\*
Text objects for inline math surrounded by \( and \).
*textobj-latex-dollar-equation*
a$ *textobj-latex-a$*
i$ *textobj-latex-i$*
Text objects for inline math surrounded by dollar
signs.
*textobj-latex-single-quote*
aq *textobj-latex-aq*
iq *textobj-latex-iq*
Text objects for single-quoted text `like this'.
*textobj-latex-double-quote*
aQ *textobj-latex-aQ*
iQ *textobj-latex-iQ*
Text objects for double-quoted text ``like this''.
*textobj-latex-environment*
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
parameters.
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
cursor:
Before After typing "cie" ~
-------------------- -------------------- ~
\begin{document} \begin{document}
Theorem: Theorem:
\begin{equation} \begin{equation}
x^2 + █
y^2 =█ \end{equation}
z^2. \end{document}
\end{equation}
\end{document}
-------------------- -------------------- ~
vim:tw=78:noet:ft=help:norl:
Jump to Line
Something went wrong with that request. Please try again.