~ubuntu-branches/ubuntu/vivid/kate/vivid-proposed

« back to all changes in this revision

Viewing changes to doc/katepart/vi.docbook

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2014-12-04 16:49:41 UTC
  • mfrom: (1.6.6)
  • Revision ID: package-import@ubuntu.com-20141204164941-l3qbvsly83hhlw2v
Tags: 4:14.11.97-0ubuntu1
* New upstream release
* Update build-deps and use pkg-kde v3 for Qt 5 build
* kate-data now kate5-data for co-installability

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--pulled in by kwrite too-->
 
2
<chapter id="vi-input-mode-chapter">
 
3
<chapterinfo>
 
4
<authorgroup><author>
 
5
&Erlend.Hamberg; &Erlend.Hamberg.mail;
 
6
</author>
 
7
<!-- TRANS:ROLES_OF_TRANSLATORS -->
 
8
</authorgroup>
 
9
</chapterinfo>
 
10
 
 
11
<title>The VI Input Mode</title>
 
12
 
 
13
<sect1 id="vi-mode-sect1">
 
14
<title>VI Input Mode</title>
 
15
 
 
16
<para>The goal of the VI mode is not to be a complete replacement
 
17
for Vim and support all Vim’s features. Its aim is to make
 
18
the <quote>Vim way</quote> of text editing - and the Vim habits learned -
 
19
available for programs using the &kappname; text editor as their internal editor.</para>
 
20
 
 
21
<para>The VI mode aims to integrate nicely with the program and deviate
 
22
from Vim’s behavior where it makes sense. For example,
 
23
<userinput><command>:w</command></userinput> will open a save dialog in &kappname;’s VI mode.</para>
 
24
 
 
25
<para>To enable the VI Input Mode for all new views, go to
 
26
<menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kappname;...</guimenuitem>
 
27
<guimenu>Editing</guimenu><guimenuitem>VI Input Mode</guimenuitem></menuchoice>.
 
28
On this tab you can set options for the VI Input Mode and define and edit
 
29
the key mapping in this mode.
 
30
VI Input Mode can also be toggled with the <guimenuitem>VI Input Mode</guimenuitem>
 
31
setting in the <guimenu>Edit</guimenu> menu. (The default shortcut key is
 
32
<keycombo action="simul"><keysym>Meta</keysym>&Ctrl;<keycap>V</keycap></keycombo>
 
33
 - where <keysym>Meta</keysym> usually is the <keysym>Windows</keysym> key).</para>
 
34
 
 
35
<note>
 
36
<para>Many Vi Mode keyboard commands are case-sensitive, unlike most &kde;
 
37
keyboard shortcuts.  That means that <userinput>y</userinput> and
 
38
<userinput>Y</userinput> are different commands.  To enter the
 
39
<userinput>y</userinput> (yank) command, make sure <keysym>Caps Lock</keysym> is
 
40
disabled and press <keycap>Y</keycap>.  To enter the <userinput>Y</userinput>
 
41
(yank to end of line) command,
 
42
<keycombo action="simul">&Shift;<keycap>Y</keycap></keycombo>.</para>
 
43
 
 
44
<para>This does not apply to commands that use the &Ctrl; key, which may be
 
45
entered regardless of <keycap>Caps Lock</keycap> mode and without pressing
 
46
&Shift;.  However, some commands require the use of a &Ctrl;-key combination
 
47
followed by another key which is case sensitive.  For instance, to input
 
48
<quote><keycombo action="simul">&Ctrl;<keycap>W</keycap></keycombo>,
 
49
<userinput>h</userinput></quote> (switch to split view right) make sure
 
50
<keycap>Caps Lock</keycap> is disabled, press
 
51
<keycombo action="simul">&Ctrl;<keycap>W</keycap></keycombo>, release, and
 
52
then press <keycap>H</keycap>.</para>
 
53
</note>
 
54
 
 
55
<sect2 id="vi-incompatibilities">
 
56
<title>Incompatibilities with Vim</title>
 
57
 
 
58
<para>There are only a few features of &kappname;’s VI mode which are incompatible
 
59
with Vim (not counting things missing). They are listed below together
 
60
with the respective reasons.</para>
 
61
<itemizedlist>
 
62
<listitem>
 
63
<para>&kappname;: <userinput>U</userinput> and
 
64
<keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo> is redo.</para>
 
65
<para>Vim: <keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo> is
 
66
normal redo, <keycap>U</keycap> is used to undo all latest changes on one line.</para>
 
67
<para>The reason for having <keycap>U</keycap> act as redo in &kappname;’s VI mode is
 
68
that the shortcut <keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo>
 
69
by default is taken by &kappname;’s replace function (search and replace). By default,
 
70
the VI mode won’t override &kappname;’s shortcuts (this can be configured in
 
71
<menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kappname;...</guimenuitem>
 
72
<guimenu>Editing</guimenu><guimenuitem>Vi Input Mode</guimenuitem></menuchoice>),
 
73
therefore a redo-action needs to be available as a <quote>regular</quote> key press, too.
 
74
Besides, the behavior of the <userinput>U</userinput> command in Vim does not map well
 
75
to &kappname;’s internal undo system, so it would be non-trivial to support anyway.</para>
 
76
</listitem>
 
77
<listitem>
 
78
<para>&kappname;: <userinput><command>print</command></userinput> shows the <guilabel>Print</guilabel> dialog.</para>
 
79
<para>Vim: <userinput><command>print</command></userinput> prints the lines of
 
80
the given range like its grandfather ed.</para>
 
81
<para>Commands like <userinput><command>:print</command></userinput> are available
 
82
not only in the VI mode but for users using <quote>regular</quote> &kappname;, too - therefore
 
83
the <userinput><command>:print</command></userinput> command opens
 
84
the print dialog - following the principle of least surprise instead of
 
85
mimicking Vim’s behavior.</para>
 
86
</listitem>
 
87
<listitem>
 
88
<para>&kappname;: <userinput>Y</userinput> yanks to end of line.</para>
 
89
<para>Vim: <userinput>Y</userinput> yanks whole line, just like
 
90
<userinput>y</userinput><userinput>y</userinput>.</para>
 
91
<para>VI’s behavior for the <userinput>Y</userinput> command is in practice a bug.
 
92
For both change and delete commands,
 
93
<userinput>c</userinput><userinput>c</userinput>/
 
94
<userinput>d</userinput><userinput>d</userinput> will do its action on
 
95
the current line and <userinput>C</userinput>/<userinput>D</userinput> will work from the
 
96
cursor column to the end of the line. However, both
 
97
<userinput>y</userinput><userinput>y</userinput> and <userinput>Y</userinput>
 
98
yanks the current line. In &kappname;’s VI Mode <userinput>Y</userinput> will yank to the end
 
99
of the line. This is described as <quote>more logical</quote> in the Vim
 
100
<ulink url="http://vimdoc.sourceforge.net/htmldoc/change.html#Y">documentation</ulink>.
 
101
</para>
 
102
</listitem>
 
103
<listitem>
 
104
<para>&kappname;: <userinput>O</userinput> and <userinput>o</userinput> opens [<replaceable>count</replaceable>] new lines
 
105
and puts you in insert mode.</para>
 
106
<para>Vim: <userinput>O</userinput> and <userinput>o</userinput> opens a new line and inserts
 
107
text [<replaceable>count</replaceable>] times when leaving insert mode.</para>
 
108
<para>This is mostly done as a consequence of witnessing many people being
 
109
confused by this behavior on a vim irc channel (#vim on freenode).</para>
 
110
</listitem>
 
111
</itemizedlist>
 
112
 
 
113
</sect2>
 
114
 
 
115
<sect2 id="vi-switching-modes">
 
116
<title>Switching Modes</title>
 
117
 
 
118
<itemizedlist>
 
119
<listitem>
 
120
<para><emphasis>Normal Mode</emphasis> permits you to enter commands to navigate or edit
 
121
a document, and is the default mode.  You can return to it from any other mode by
 
122
pressing &Esc;.
 
123
</para></listitem>
 
124
<listitem>
 
125
<para><emphasis>Visual Mode</emphasis> permits you to highlight text in a document.
 
126
Most Normal Mode commands are also valid in this mode.  You can enter it by pressing
 
127
<userinput>v</userinput> to select characters or <userinput>V</userinput> to select lines.
 
128
</para></listitem>
 
129
<listitem>
 
130
<para><emphasis>Insert Mode</emphasis> permits you to edit the document directly. You
 
131
can enter it by pressing <userinput>i</userinput> or one of several other commands
 
132
listed below.
 
133
</para></listitem>
 
134
<listitem>
 
135
<para><emphasis>Command Mode</emphasis> invokes &kappname;'s command line,
 
136
permitting you to run many commands available in Vi implementations as well as
 
137
some specific to &kappname;.  For more information on these commands, see
 
138
<xref linkend="advanced-editing-tools-commandline" />.  To use it,
 
139
press <keycap>:</keycap>, enter the command, and press &Enter;.</para>
 
140
</listitem>
 
141
</itemizedlist>
 
142
<!-- add a picture like http://de.wikipedia.org/wiki/Vi#Arbeitsmodi here? -->
 
143
</sect2>
 
144
 
 
145
<sect2 id="vi-integration">
 
146
<title>Integration with Kate features</title>
 
147
<itemizedlist>
 
148
 
 
149
<listitem>
 
150
<para>Visual Mode is entered automatically when text is selected with the mouse.
 
151
It is also entered when using functions of Kate that select text, such as Select
 
152
All (either from the menu or via <keycombo action="simul">&Ctrl;<keycap>A</keycap>
 
153
</keycombo>.)</para>
 
154
</listitem>
 
155
 
 
156
<listitem>
 
157
<para>Vi marks and <link linkend="kate-part-bookmarks">Kate bookmarks</link> are
 
158
integrated.  When a mark is created in Vi Mode, a corresponding Kate bookmark is
 
159
created and appears in the <guimenu>Bookmarks</guimenu> menu.  Conversely, when
 
160
a Kate bookmark is created, a corresponding Vi mark at the 0 column is also
 
161
created.</para>
 
162
</listitem>
 
163
 
 
164
</itemizedlist>
 
165
</sect2>
 
166
 
 
167
<sect2 id="vi-normal-visual-mode-commands">
 
168
<title>Supported normal/visual mode commands</title>
 
169
 
 
170
<informaltable>
 
171
<tgroup cols="2">
 
172
<!--thead>
 
173
<row>
 
174
<entry><para>Key</para></entry>
 
175
<entry><para>Command</para></entry>
 
176
</row>
 
177
</thead-->
 
178
<tbody>
 
179
<row><entry><para><userinput>a</userinput></para></entry>
 
180
<entry><para>Enter Insert Mode; append after cursor</para></entry>
 
181
</row>
 
182
<row><entry><para><userinput>A</userinput></para></entry>
 
183
<entry><para>Enter Insert Mode; append after line</para></entry>
 
184
</row>
 
185
<row><entry><para><userinput>i</userinput></para></entry>
 
186
<entry><para>Enter Insert Mode; insert before cursor</para></entry>
 
187
</row>
 
188
<row><entry><para><keycap>Insert</keycap></para></entry>
 
189
<entry><para>Enter Insert Mode; insert before cursor</para></entry>
 
190
</row>
 
191
<row><entry><para><userinput>I</userinput></para></entry>
 
192
<entry><para>Enter Insert Mode; insert before first non-blank char on line</para></entry>
 
193
</row>
 
194
<row><entry><para><userinput>gi</userinput></para></entry>
 
195
<entry><para>Enter Insert Mode; insert before place, where leaving the last insert mode</para></entry>
 
196
</row>
 
197
<row><entry><para><userinput>v</userinput></para></entry>
 
198
<entry><para>Enter Visual Mode; select characters</para></entry>
 
199
</row>
 
200
<row><entry><para><userinput>V</userinput></para></entry>
 
201
<entry><para>Enter Visual Mode; select lines</para></entry>
 
202
</row>
 
203
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>v</keycap></keycombo></para></entry>
 
204
<entry><para>Enter Visual Mode; select blocks</para></entry>
 
205
</row>
 
206
<row><entry><para><userinput>gb</userinput></para></entry>
 
207
<entry><para>Enter Visual Mode; reselect the last selection</para></entry>
 
208
</row>
 
209
<row><entry><para><userinput>o</userinput></para></entry>
 
210
<entry><para>Open a new line below current line</para></entry>
 
211
</row>
 
212
<row><entry><para><userinput>O</userinput></para></entry>
 
213
<entry><para>Open a new line above current line</para></entry>
 
214
</row>
 
215
<row><entry><para><userinput>J</userinput></para></entry>
 
216
<entry><para>Join lines</para></entry>
 
217
</row>
 
218
<row><entry><para><userinput>c</userinput></para></entry>
 
219
<entry><para>Change:  follow by a motion to delete and enter Insert mode</para></entry>
 
220
</row>
 
221
<row><entry><para><userinput>C</userinput></para></entry>
 
222
<entry><para>Change to end of line:  Delete to end of line and enter Insert Mode</para></entry>
 
223
</row>
 
224
<row><entry><para><userinput>cc</userinput></para></entry>
 
225
<entry><para>Change line:  Delete line and enter Insert Mode</para></entry>
 
226
</row>
 
227
<row><entry><para><userinput>s</userinput></para></entry>
 
228
<entry><para>Substitute character<!--needs explanation--></para></entry>
 
229
</row>
 
230
<row><entry><para><userinput>S</userinput></para></entry>
 
231
<entry><para>Substitute line<!--needs explanation--></para></entry>
 
232
</row>
 
233
<row><entry><para><userinput>dd</userinput></para></entry>
 
234
<entry><para>Delete line</para></entry>
 
235
</row>
 
236
<row><entry><para><userinput>d</userinput></para></entry>
 
237
<entry><para>Follow by a motion to delete</para></entry>
 
238
</row>
 
239
<row><entry><para><userinput>D</userinput></para></entry>
 
240
<entry><para>Delete to end of line</para></entry>
 
241
</row>
 
242
<row><entry><para><userinput>x</userinput></para></entry>
 
243
<entry><para>Delete character to right of cursor</para></entry>
 
244
</row>
 
245
<row><entry><para><keycap>Delete</keycap></para></entry>
 
246
<entry><para>Delete character to right of cursor</para></entry>
 
247
</row>
 
248
<row><entry><para><userinput>X</userinput></para></entry>
 
249
<entry><para>Delete character to left of cursor</para></entry>
 
250
</row>
 
251
<row><entry><para><userinput>gu</userinput></para></entry>
 
252
<entry><para>Follow with a motion to make lowercase</para></entry>
 
253
</row>
 
254
<row><entry><para><userinput>guu</userinput></para></entry>
 
255
<entry><para>Make the current line lowercase</para></entry>
 
256
</row>
 
257
<row><entry><para><userinput>gU</userinput></para></entry>
 
258
<entry><para>Follow with a motion to make uppercase</para></entry>
 
259
</row>
 
260
<row><entry><para><userinput>gUU</userinput></para></entry>
 
261
<entry><para>Make the current line uppercase</para></entry>
 
262
</row>
 
263
<row><entry><para><userinput>y</userinput></para></entry>
 
264
<entry><para>Follow by a motion to <quote>yank</quote> (copy)</para></entry>
 
265
</row>
 
266
<row><entry><para><userinput>yy</userinput></para></entry>
 
267
<entry><para>Yank (copy) line</para></entry>
 
268
</row>
 
269
<row><entry><para><userinput>Y</userinput></para></entry>
 
270
<entry><para>Yank (copy) line</para></entry>
 
271
</row>
 
272
<row><entry><para><userinput>p</userinput></para></entry>
 
273
<entry><para>Paste after cursor</para></entry>
 
274
</row>
 
275
<row><entry><para><userinput>P</userinput></para></entry>
 
276
<entry><para>Paste before cursor</para></entry>
 
277
</row>
 
278
<row><entry><para><userinput>]p</userinput></para></entry>
 
279
<entry><para>Paste after cursor indented</para></entry>
 
280
</row>
 
281
<row><entry><para><userinput>[p</userinput></para></entry>
 
282
<entry><para>Paste before cursor indented</para></entry>
 
283
</row>
 
284
<row><entry><para><userinput>r</userinput></para></entry>
 
285
<entry><para>Follow with a character to replace the character after the cursor</para></entry>
 
286
</row>
 
287
<row><entry><para><userinput>R</userinput></para></entry>
 
288
<entry><para>Enter Replace Mode</para></entry>
 
289
</row>
 
290
<row><entry><para><userinput>:</userinput></para></entry>
 
291
<entry><para>Enter Command Mode</para></entry>
 
292
</row>
 
293
<row><entry><para><userinput>/</userinput></para></entry>
 
294
<entry><para>Search</para></entry>
 
295
</row>
 
296
<row><entry><para><userinput>u</userinput></para></entry>
 
297
<entry><para>Undo</para></entry>
 
298
</row>
 
299
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo></para></entry>
 
300
<entry><para>Redo</para></entry>
 
301
</row>
 
302
<row><entry><para><userinput>U</userinput></para></entry>
 
303
<entry><para>Redo</para></entry>
 
304
</row>
 
305
<row><entry><para><userinput>m</userinput></para></entry>
 
306
<entry><para>Set mark (can be used by motions later)</para></entry>
 
307
</row>
 
308
<row><entry><para><userinput>n</userinput></para></entry>
 
309
<entry><para>Find next</para></entry>
 
310
</row>
 
311
<row><entry><para><userinput>N</userinput></para></entry>
 
312
<entry><para>Find previous</para></entry>
 
313
</row>
 
314
<row><entry><para><userinput>&gt;&gt;</userinput></para></entry>
 
315
<entry><para>Indent line</para></entry>
 
316
</row>
 
317
<row><entry><para><userinput>&lt;&lt;</userinput></para></entry>
 
318
<entry><para>Unindent line</para></entry>
 
319
</row>
 
320
<row><entry><para><userinput>&gt;</userinput></para></entry>
 
321
<entry><para>Indent lines</para></entry>
 
322
</row>
 
323
<row><entry><para><userinput>&lt;</userinput></para></entry>
 
324
<entry><para>Unindent lines</para></entry>
 
325
</row>
 
326
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>F</keycap></keycombo></para></entry>
 
327
<entry><para>Page down</para></entry>
 
328
</row>
 
329
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>B</keycap></keycombo></para></entry>
 
330
<entry><para>Page up</para></entry>
 
331
</row>
 
332
<row><entry><para><userinput>ga</userinput></para></entry>
 
333
<entry><para>Print the ASCII value of the character</para></entry>
 
334
</row>
 
335
<row><entry><para><userinput>.</userinput></para></entry>
 
336
<entry><para>Repeat last change</para></entry>
 
337
</row>
 
338
<row><entry><para><userinput>==</userinput></para></entry>
 
339
<entry><para>commandAlignLine<!--needs explanation--></para></entry>
 
340
</row>
 
341
<row><entry><para><userinput>=</userinput></para></entry>
 
342
<entry><para>commandAlignLines<!--needs explanation--></para></entry>
 
343
</row>
 
344
<row><entry><para><userinput>~</userinput></para></entry>
 
345
<entry><para>Change case of current character</para></entry>
 
346
</row>
 
347
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo></para></entry>
 
348
<entry><para>Split view horizontally</para></entry>
 
349
</row>
 
350
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>V</keycap></keycombo></para></entry>
 
351
<entry><para>Split view vertically</para></entry>
 
352
</row>
 
353
<row><entry><para><keycombo action="simul">&Ctrl;
 
354
<keycap>W</keycap></keycombo>, <userinput>w</userinput></para></entry>
 
355
<entry><para>Cycle to next split window</para></entry>
 
356
</row>
 
357
<row><entry><para><keycombo action="simul">&Ctrl;
 
358
<keycap>W</keycap></keycombo>, <userinput>h</userinput></para>
 
359
<para><keycombo action="seq"><keycombo action="simul">&Ctrl;
 
360
<keycap>W</keycap></keycombo><keysym>Left</keysym></keycombo></para></entry>
 
361
<entry><para>Go to left split window</para></entry>
 
362
</row>
 
363
<row><entry><para><keycombo action="simul">&Ctrl;
 
364
<keycap>W</keycap></keycombo>, <userinput>l</userinput></para>
 
365
<para><keycombo action="seq"><keycombo action="simul">&Ctrl;
 
366
<keycap>W</keycap></keycombo><keysym>Right</keysym></keycombo></para></entry>
 
367
<entry><para>Go to right split window</para></entry>
 
368
</row>
 
369
<row><entry><para><keycombo action="simul">&Ctrl;
 
370
<keycap>W</keycap></keycombo>, <userinput>k</userinput></para>
 
371
<para><keycombo action="seq"><keycombo action="simul">&Ctrl;
 
372
<keycap>W</keycap></keycombo><keysym>Up</keysym></keycombo></para></entry>
 
373
<entry><para>Go to above split window</para></entry>
 
374
</row>
 
375
<row><entry><para><keycombo action="simul">&Ctrl;
 
376
<keycap>W</keycap></keycombo>, <userinput>j</userinput></para>
 
377
<para><keycombo action="seq"><keycombo action="simul">&Ctrl;
 
378
<keycap>W</keycap></keycombo><keysym>Down</keysym></keycombo></para></entry>
 
379
<entry><para>Go to below split window</para></entry>
 
380
</row>
 
381
</tbody>
 
382
</tgroup>
 
383
</informaltable>
 
384
</sect2>
 
385
 
 
386
<sect2 id="vi-supported-motions">
 
387
<title>Supported motions</title>
 
388
 
 
389
<para>These may be used to move around a document in Normal or Visual mode, or in
 
390
conjunction with one of the above commands.  They may be preceded by a count,
 
391
which indicates how many of the appropriate movements to make.</para>
 
392
 
 
393
<informaltable>
 
394
<tgroup cols="2">
 
395
<!--thead>
 
396
<row>
 
397
<entry><para>Key</para></entry>
 
398
<entry><para>Command</para></entry>
 
399
</row>
 
400
</thead-->
 
401
<tbody>
 
402
<row><entry><para><userinput>h</userinput></para></entry>
 
403
<entry><para>Left</para></entry>
 
404
</row>
 
405
<row><entry><para><keysym>Left</keysym></para></entry>
 
406
<entry><para>Left</para></entry>
 
407
</row>
 
408
<row><entry><para>&Backspace;</para></entry>
 
409
<entry><para>Left</para></entry>
 
410
</row>
 
411
<row><entry><para><userinput>j</userinput></para></entry>
 
412
<entry><para>Down</para></entry>
 
413
</row>
 
414
<row><entry><para><keysym>Down</keysym></para></entry>
 
415
<entry><para>Down</para></entry>
 
416
</row>
 
417
<row><entry><para><userinput>k</userinput></para></entry>
 
418
<entry><para>Up</para></entry>
 
419
</row>
 
420
<row><entry><para><keysym>Up</keysym></para></entry>
 
421
<entry><para>Up</para></entry>
 
422
</row>
 
423
<row><entry><para><userinput>l</userinput></para></entry>
 
424
<entry><para>Right</para></entry>
 
425
</row>
 
426
<row><entry><para><keysym>Right</keysym></para></entry>
 
427
<entry><para>Right</para></entry>
 
428
</row>
 
429
<row><entry><para><keysym>Space</keysym></para></entry>
 
430
<entry><para>Right</para></entry>
 
431
</row>
 
432
<row><entry><para><userinput>$</userinput></para></entry>
 
433
<entry><para>End of line</para></entry>
 
434
</row>
 
435
<row><entry><para><keycap>End</keycap></para></entry>
 
436
<entry><para>End of line</para></entry>
 
437
</row>
 
438
<row><entry><para><userinput>0</userinput></para></entry>
 
439
<entry><para>First character of line (Column 0)</para></entry>
 
440
</row>
 
441
<row><entry><para><keycap>Home</keycap></para></entry>
 
442
<entry><para>First character of line</para></entry>
 
443
</row>
 
444
<row><entry><para><userinput>^</userinput></para></entry>
 
445
<entry><para>First non-blank character of line</para></entry>
 
446
</row>
 
447
<row><entry><para><userinput>f</userinput></para></entry>
 
448
<entry><para>Follow by character to move to right of cursor</para></entry>
 
449
</row>
 
450
<row><entry><para><userinput>F</userinput></para></entry>
 
451
<entry><para>Follow by character to move to left of cursor</para></entry>
 
452
</row>
 
453
<row><entry><para><userinput>t</userinput></para></entry>
 
454
<entry><para>Follow by character to move to right of cursor, placing the cursor on character before it</para></entry>
 
455
</row>
 
456
<row><entry><para><userinput>T</userinput></para></entry>
 
457
<entry><para>Follow by character to move to left of cursor, placing the cursor on character before it</para></entry>
 
458
</row>
 
459
<row><entry><para><userinput>gg</userinput></para></entry>
 
460
<entry><para>First line</para></entry>
 
461
</row>
 
462
<row><entry><para><userinput>G</userinput></para></entry>
 
463
<entry><para>Last line</para></entry>
 
464
</row>
 
465
<row><entry><para><userinput>w</userinput></para></entry>
 
466
<entry><para>Next Word</para></entry>
 
467
</row>
 
468
<row><entry><para><userinput>W</userinput></para></entry>
 
469
<entry><para>Next word separated by whitespace</para></entry>
 
470
</row>
 
471
<row><entry><para><userinput>b</userinput></para></entry>
 
472
<entry><para>Previous word</para></entry>
 
473
</row>
 
474
<row><entry><para><userinput>B</userinput></para></entry>
 
475
<entry><para>Previous word separated by whitespace</para></entry>
 
476
</row>
 
477
<row><entry><para><userinput>e</userinput></para></entry>
 
478
<entry><para>End of word</para></entry>
 
479
</row>
 
480
<row><entry><para><userinput>E</userinput></para></entry>
 
481
<entry><para>End of word separated by whitespace</para></entry>
 
482
</row>
 
483
<row><entry><para><userinput>ge</userinput></para></entry>
 
484
<entry><para>End of previous word</para></entry>
 
485
</row>
 
486
<row><entry><para><userinput>gE</userinput></para></entry>
 
487
<entry><para>End of previous word separated by whitespace</para></entry>
 
488
</row>
 
489
<row><entry><para><userinput>|</userinput></para></entry>
 
490
<entry><para>Follow by a column number to move to that column</para></entry>
 
491
</row>
 
492
<row><entry><para><userinput>%</userinput></para></entry>
 
493
<entry><para>Follow by an item to move to that item<!--needs explanation--></para></entry>
 
494
</row>
 
495
<row><entry><para><userinput>`</userinput></para></entry>
 
496
<entry><para>Mark</para></entry>
 
497
</row>
 
498
<row><entry><para><userinput>‘</userinput></para></entry>
 
499
<entry><para>First non-whitespace character of the line the mark is on</para></entry>
 
500
</row>
 
501
<row><entry><para><userinput>[[</userinput></para></entry>
 
502
<entry><para>Previous opening bracket</para></entry>
 
503
</row>
 
504
<row><entry><para><userinput>]]</userinput></para></entry>
 
505
<entry><para>Next opening bracket</para></entry>
 
506
</row>
 
507
<row><entry><para><userinput>[]</userinput></para></entry>
 
508
<entry><para>Previous closing bracket</para></entry>
 
509
</row>
 
510
<row><entry><para><userinput>][</userinput></para></entry>
 
511
<entry><para>Next closing bracket</para></entry>
 
512
</row>
 
513
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>I</keycap></keycombo></para></entry>
 
514
<entry><para>Jump forward to next location</para></entry></row>
 
515
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>O</keycap></keycombo></para></entry>
 
516
<entry><para>Jump back to previous location</para></entry></row>
 
517
<row><entry><para><userinput>H</userinput></para></entry>
 
518
<entry>Go to first line of screen</entry></row>
 
519
<row><entry><para><userinput>M</userinput></para></entry>
 
520
<entry>Go to middle line of screen</entry></row>
 
521
<row><entry><para><userinput>L</userinput></para></entry>
 
522
<entry>Go to last line of screen</entry></row>
 
523
<row><entry><para><userinput>%<replaceable>percentage</replaceable></userinput></para></entry>
 
524
<entry><para>Go to specified percentage of the document</para></entry></row>
 
525
<row><entry><para><userinput>gk</userinput></para></entry>
 
526
<entry><para>Go one line up visually (when using dynamic word wrap)</para></entry></row>
 
527
<row><entry><para><userinput>gj</userinput></para></entry>
 
528
<entry><para>Go one line down visually (when using dynamic word wrap)</para></entry></row>
 
529
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>Left</keycap></keycombo></para></entry>
 
530
<entry><para>Move one word left</para></entry>
 
531
</row>
 
532
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>Right</keycap></keycombo></para></entry>
 
533
<entry><para>Move one word right</para></entry>
 
534
</row>
 
535
</tbody>
 
536
</tgroup>
 
537
</informaltable>
 
538
</sect2>
 
539
 
 
540
<sect2 id="vi-supported-text-objects">
 
541
<title>Supported text objects</title>
 
542
 
 
543
<para>These may be used to select certain portions of a document.</para>
 
544
 
 
545
<informaltable>
 
546
<tgroup cols="2">
 
547
<!--thead>
 
548
<row>
 
549
<entry><para>Key</para></entry>
 
550
<entry><para>Command</para></entry>
 
551
</row>
 
552
</thead-->
 
553
<tbody>
 
554
<row><entry><para><userinput>iw</userinput></para></entry>
 
555
<entry><para>Inner word: word including whitespace</para></entry>
 
556
</row>
 
557
<row><entry><para><userinput>aw</userinput></para></entry>
 
558
<entry><para>A word: word excluding whitespace</para></entry>
 
559
</row>
 
560
<row><entry><para><userinput>i"</userinput></para></entry>
 
561
<entry><para>Previous double-quote (<userinput>"</userinput>) to next double-quote,
 
562
including quotation marks</para></entry>
 
563
</row>
 
564
<row><entry><para><userinput>a”</userinput></para></entry>
 
565
<entry><para>Previous double-quote (<userinput>"</userinput>) to next double-quote,
 
566
excluding quotation marks</para></entry>
 
567
</row>
 
568
<row><entry><para><userinput>i'</userinput></para></entry>
 
569
<entry><para>Previous single-quote (<userinput>'</userinput>) to next single-quote,
 
570
including quotation marks</para></entry>
 
571
</row>
 
572
<row><entry><para><userinput>a'</userinput></para></entry>
 
573
<entry><para>Previous single-quote (<userinput>'</userinput>) to next single-quote,
 
574
excluding quotation marks</para></entry>
 
575
</row>
 
576
<row><entry><para><userinput>i(</userinput></para></entry>
 
577
<entry><para>Previous opening parenthesis [<userinput>(</userinput>] to next closing
 
578
parenthesis [<userinput>)</userinput>], including the parenthesis</para></entry>
 
579
</row>
 
580
<row><entry><para><userinput>a(</userinput></para></entry>
 
581
<entry><para>Previous opening parenthesis [<userinput>(</userinput>] to next closing
 
582
parenthesis [<userinput>)</userinput>], excluding the parenthesis</para></entry>
 
583
</row>
 
584
<row><entry><para><userinput>i[</userinput></para></entry>
 
585
<entry><para>Previous opening square bracket (<userinput>[</userinput>) to next closing
 
586
square bracket (<userinput>]</userinput>), including the brackets</para></entry>
 
587
</row>
 
588
<row><entry><para><userinput>a[</userinput></para></entry>
 
589
<entry><para>Previous opening square bracket (<userinput>[</userinput>) to next closing
 
590
square bracket (<userinput>]</userinput>), excluding the brackets</para></entry>
 
591
</row>
 
592
<row><entry><para><userinput>i{</userinput></para></entry>
 
593
<entry><para>Previous opening curly bracket (<userinput>{</userinput>) to next closing
 
594
curly bracket (<userinput>}</userinput>), including the brackets</para></entry>
 
595
</row>
 
596
<row><entry><para><userinput>a{</userinput></para></entry>
 
597
<entry><para>Previous opening curly bracket (<userinput>{</userinput>) to next closing
 
598
curly bracket (<userinput>}</userinput>), excluding the brackets</para></entry>
 
599
</row>
 
600
<row><entry><para><userinput>i&lt;</userinput></para></entry>
 
601
<entry><para>Previous opening angle bracket (<userinput>&lt;</userinput>) to next closing
 
602
angle bracket (<userinput>&gt;</userinput>), including the brackets</para></entry>
 
603
</row>
 
604
<row><entry><para><userinput>a&lt;</userinput></para></entry>
 
605
<entry><para>Previous opening angle bracket (<userinput>&lt;</userinput>) to next closing
 
606
square bracket (<userinput>&gt;</userinput>), excluding the brackets</para></entry>
 
607
</row>
 
608
<row><entry><para><userinput>i`</userinput></para></entry>
 
609
<entry><para>Previous backtick (<userinput>`</userinput>) to next backtick,
 
610
including the backticks</para></entry>
 
611
</row>
 
612
<row><entry><para><userinput>a`</userinput></para></entry>
 
613
<entry><para>Previous backtick (<userinput>`</userinput>) to next backtick,
 
614
excluding the backticks</para></entry>
 
615
</row>
 
616
</tbody>
 
617
</tgroup>
 
618
</informaltable>
 
619
</sect2>
 
620
 
 
621
<sect2 id="vi-insert-mode-commands">
 
622
<title>Supported insert mode commands</title>
 
623
 
 
624
<informaltable>
 
625
<tgroup cols="2">
 
626
<!--thead>
 
627
<row>
 
628
<entry><para>Key</para></entry>
 
629
<entry><para>Command</para></entry>
 
630
</row>
 
631
</thead-->
 
632
<tbody>
 
633
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>D</keycap></keycombo></para></entry>
 
634
<entry><para>Unindent</para></entry>
 
635
</row>
 
636
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>T</keycap></keycombo></para></entry>
 
637
<entry><para>Indent</para></entry>
 
638
</row>
 
639
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>E</keycap></keycombo></para></entry>
 
640
<entry><para>Insert from below</para></entry>
 
641
</row>
 
642
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>Y</keycap></keycombo></para></entry>
 
643
<entry><para>Delete word</para></entry>
 
644
</row>
 
645
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>W</keycap></keycombo></para></entry>
 
646
<entry><para>Delete word</para></entry>
 
647
</row>
 
648
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>U</keycap></keycombo></para></entry>
 
649
<entry><para>Delete line</para></entry>
 
650
</row>
 
651
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>J</keycap></keycombo></para></entry>
 
652
<entry><para>New line</para></entry>
 
653
</row>
 
654
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>H</keycap></keycombo></para></entry>
 
655
<entry><para>Delete char backward</para></entry>
 
656
</row>
 
657
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>Home</keycap></keycombo></para></entry>
 
658
<entry><para>Move to first character in the document</para></entry>
 
659
</row>
 
660
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo>
 
661
<userinput>n</userinput></para></entry>
 
662
<entry>Insert the contents of register <literal>n</literal></entry></row>
 
663
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>O</keycap></keycombo>,
 
664
<replaceable>command</replaceable></para></entry>
 
665
<entry><para>Enter normal mode for one command only</para></entry></row>
 
666
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>A</keycap></keycombo></para></entry>
 
667
<entry><para>Increment currently selected number</para></entry></row>
 
668
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>X</keycap></keycombo></para></entry>
 
669
<entry><para>Decrement currently selected number</para></entry></row>
 
670
</tbody>
 
671
</tgroup>
 
672
</informaltable>
 
673
</sect2>
 
674
 
 
675
<sect2 id="vi-text-object">
 
676
<title>The Comma Text Object</title>
 
677
 
 
678
<para>This object is missing in Vim. The comma text object
 
679
makes it easy to modify parameter lists in C-like languages and other comma
 
680
separated lists. It is basically the area between two commas or between a comma
 
681
and a bracket. In the line shown in the illustration, the three
 
682
ranges this text object can span are highlighted.</para>
 
683
 
 
684
<screenshot id="screenshot-resources">
 
685
<screeninfo>An example of Comma Text Object</screeninfo>
 
686
<mediaobject>
 
687
<imageobject><imagedata fileref="comma-to.png" format="PNG"/></imageobject>
 
688
<textobject><phrase>An example of Comma Text Object</phrase></textobject>
 
689
<caption><para>Comma text object ranges. If the cursor is over &eg;
 
690
<replaceable>arg2</replaceable>, pressing
 
691
<userinput>ci</userinput>, (<quote>change inner comma</quote>)
 
692
would delete <replaceable>double arg2</replaceable> and place the cursor between
 
693
the two commas in insert mode. A very convenient way to change a function's
 
694
parameters.</para></caption>
 
695
</mediaobject>
 
696
</screenshot>
 
697
 
 
698
</sect2>
 
699
 
 
700
<sect2 id="vi-missing-features">
 
701
<title>Missing Features</title>
 
702
 
 
703
<para>As stated earlier, the goal of &kappname;’s VI Mode is not to support 100% of
 
704
Vim’s features.</para>
 
705
</sect2>
 
706
 
 
707
</sect1>
 
708
 
 
709
</chapter>