/
textobj-latex.txt
97 lines (74 loc) · 2.83 KB
/
textobj-latex.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
*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: