1
<!--pulled in by kwrite too-->
2
<chapter id="vi-input-mode-chapter">
5
&Erlend.Hamberg; &Erlend.Hamberg.mail;
7
<!-- TRANS:ROLES_OF_TRANSLATORS -->
11
<title>The VI Input Mode</title>
13
<sect1 id="vi-mode-sect1">
14
<title>VI Input Mode</title>
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>
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>
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>
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>
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>
55
<sect2 id="vi-incompatibilities">
56
<title>Incompatibilities with Vim</title>
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>
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>
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>
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>.
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>
115
<sect2 id="vi-switching-modes">
116
<title>Switching Modes</title>
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
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.
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
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>
142
<!-- add a picture like http://de.wikipedia.org/wiki/Vi#Arbeitsmodi here? -->
145
<sect2 id="vi-integration">
146
<title>Integration with Kate features</title>
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>
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
167
<sect2 id="vi-normal-visual-mode-commands">
168
<title>Supported normal/visual mode commands</title>
174
<entry><para>Key</para></entry>
175
<entry><para>Command</para></entry>
179
<row><entry><para><userinput>a</userinput></para></entry>
180
<entry><para>Enter Insert Mode; append after cursor</para></entry>
182
<row><entry><para><userinput>A</userinput></para></entry>
183
<entry><para>Enter Insert Mode; append after line</para></entry>
185
<row><entry><para><userinput>i</userinput></para></entry>
186
<entry><para>Enter Insert Mode; insert before cursor</para></entry>
188
<row><entry><para><keycap>Insert</keycap></para></entry>
189
<entry><para>Enter Insert Mode; insert before cursor</para></entry>
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>
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>
197
<row><entry><para><userinput>v</userinput></para></entry>
198
<entry><para>Enter Visual Mode; select characters</para></entry>
200
<row><entry><para><userinput>V</userinput></para></entry>
201
<entry><para>Enter Visual Mode; select lines</para></entry>
203
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>v</keycap></keycombo></para></entry>
204
<entry><para>Enter Visual Mode; select blocks</para></entry>
206
<row><entry><para><userinput>gb</userinput></para></entry>
207
<entry><para>Enter Visual Mode; reselect the last selection</para></entry>
209
<row><entry><para><userinput>o</userinput></para></entry>
210
<entry><para>Open a new line below current line</para></entry>
212
<row><entry><para><userinput>O</userinput></para></entry>
213
<entry><para>Open a new line above current line</para></entry>
215
<row><entry><para><userinput>J</userinput></para></entry>
216
<entry><para>Join lines</para></entry>
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>
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>
224
<row><entry><para><userinput>cc</userinput></para></entry>
225
<entry><para>Change line: Delete line and enter Insert Mode</para></entry>
227
<row><entry><para><userinput>s</userinput></para></entry>
228
<entry><para>Substitute character<!--needs explanation--></para></entry>
230
<row><entry><para><userinput>S</userinput></para></entry>
231
<entry><para>Substitute line<!--needs explanation--></para></entry>
233
<row><entry><para><userinput>dd</userinput></para></entry>
234
<entry><para>Delete line</para></entry>
236
<row><entry><para><userinput>d</userinput></para></entry>
237
<entry><para>Follow by a motion to delete</para></entry>
239
<row><entry><para><userinput>D</userinput></para></entry>
240
<entry><para>Delete to end of line</para></entry>
242
<row><entry><para><userinput>x</userinput></para></entry>
243
<entry><para>Delete character to right of cursor</para></entry>
245
<row><entry><para><keycap>Delete</keycap></para></entry>
246
<entry><para>Delete character to right of cursor</para></entry>
248
<row><entry><para><userinput>X</userinput></para></entry>
249
<entry><para>Delete character to left of cursor</para></entry>
251
<row><entry><para><userinput>gu</userinput></para></entry>
252
<entry><para>Follow with a motion to make lowercase</para></entry>
254
<row><entry><para><userinput>guu</userinput></para></entry>
255
<entry><para>Make the current line lowercase</para></entry>
257
<row><entry><para><userinput>gU</userinput></para></entry>
258
<entry><para>Follow with a motion to make uppercase</para></entry>
260
<row><entry><para><userinput>gUU</userinput></para></entry>
261
<entry><para>Make the current line uppercase</para></entry>
263
<row><entry><para><userinput>y</userinput></para></entry>
264
<entry><para>Follow by a motion to <quote>yank</quote> (copy)</para></entry>
266
<row><entry><para><userinput>yy</userinput></para></entry>
267
<entry><para>Yank (copy) line</para></entry>
269
<row><entry><para><userinput>Y</userinput></para></entry>
270
<entry><para>Yank (copy) line</para></entry>
272
<row><entry><para><userinput>p</userinput></para></entry>
273
<entry><para>Paste after cursor</para></entry>
275
<row><entry><para><userinput>P</userinput></para></entry>
276
<entry><para>Paste before cursor</para></entry>
278
<row><entry><para><userinput>]p</userinput></para></entry>
279
<entry><para>Paste after cursor indented</para></entry>
281
<row><entry><para><userinput>[p</userinput></para></entry>
282
<entry><para>Paste before cursor indented</para></entry>
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>
287
<row><entry><para><userinput>R</userinput></para></entry>
288
<entry><para>Enter Replace Mode</para></entry>
290
<row><entry><para><userinput>:</userinput></para></entry>
291
<entry><para>Enter Command Mode</para></entry>
293
<row><entry><para><userinput>/</userinput></para></entry>
294
<entry><para>Search</para></entry>
296
<row><entry><para><userinput>u</userinput></para></entry>
297
<entry><para>Undo</para></entry>
299
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo></para></entry>
300
<entry><para>Redo</para></entry>
302
<row><entry><para><userinput>U</userinput></para></entry>
303
<entry><para>Redo</para></entry>
305
<row><entry><para><userinput>m</userinput></para></entry>
306
<entry><para>Set mark (can be used by motions later)</para></entry>
308
<row><entry><para><userinput>n</userinput></para></entry>
309
<entry><para>Find next</para></entry>
311
<row><entry><para><userinput>N</userinput></para></entry>
312
<entry><para>Find previous</para></entry>
314
<row><entry><para><userinput>>></userinput></para></entry>
315
<entry><para>Indent line</para></entry>
317
<row><entry><para><userinput><<</userinput></para></entry>
318
<entry><para>Unindent line</para></entry>
320
<row><entry><para><userinput>></userinput></para></entry>
321
<entry><para>Indent lines</para></entry>
323
<row><entry><para><userinput><</userinput></para></entry>
324
<entry><para>Unindent lines</para></entry>
326
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>F</keycap></keycombo></para></entry>
327
<entry><para>Page down</para></entry>
329
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>B</keycap></keycombo></para></entry>
330
<entry><para>Page up</para></entry>
332
<row><entry><para><userinput>ga</userinput></para></entry>
333
<entry><para>Print the ASCII value of the character</para></entry>
335
<row><entry><para><userinput>.</userinput></para></entry>
336
<entry><para>Repeat last change</para></entry>
338
<row><entry><para><userinput>==</userinput></para></entry>
339
<entry><para>commandAlignLine<!--needs explanation--></para></entry>
341
<row><entry><para><userinput>=</userinput></para></entry>
342
<entry><para>commandAlignLines<!--needs explanation--></para></entry>
344
<row><entry><para><userinput>~</userinput></para></entry>
345
<entry><para>Change case of current character</para></entry>
347
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo></para></entry>
348
<entry><para>Split view horizontally</para></entry>
350
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>V</keycap></keycombo></para></entry>
351
<entry><para>Split view vertically</para></entry>
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>
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>
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>
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>
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>
386
<sect2 id="vi-supported-motions">
387
<title>Supported motions</title>
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>
397
<entry><para>Key</para></entry>
398
<entry><para>Command</para></entry>
402
<row><entry><para><userinput>h</userinput></para></entry>
403
<entry><para>Left</para></entry>
405
<row><entry><para><keysym>Left</keysym></para></entry>
406
<entry><para>Left</para></entry>
408
<row><entry><para>&Backspace;</para></entry>
409
<entry><para>Left</para></entry>
411
<row><entry><para><userinput>j</userinput></para></entry>
412
<entry><para>Down</para></entry>
414
<row><entry><para><keysym>Down</keysym></para></entry>
415
<entry><para>Down</para></entry>
417
<row><entry><para><userinput>k</userinput></para></entry>
418
<entry><para>Up</para></entry>
420
<row><entry><para><keysym>Up</keysym></para></entry>
421
<entry><para>Up</para></entry>
423
<row><entry><para><userinput>l</userinput></para></entry>
424
<entry><para>Right</para></entry>
426
<row><entry><para><keysym>Right</keysym></para></entry>
427
<entry><para>Right</para></entry>
429
<row><entry><para><keysym>Space</keysym></para></entry>
430
<entry><para>Right</para></entry>
432
<row><entry><para><userinput>$</userinput></para></entry>
433
<entry><para>End of line</para></entry>
435
<row><entry><para><keycap>End</keycap></para></entry>
436
<entry><para>End of line</para></entry>
438
<row><entry><para><userinput>0</userinput></para></entry>
439
<entry><para>First character of line (Column 0)</para></entry>
441
<row><entry><para><keycap>Home</keycap></para></entry>
442
<entry><para>First character of line</para></entry>
444
<row><entry><para><userinput>^</userinput></para></entry>
445
<entry><para>First non-blank character of line</para></entry>
447
<row><entry><para><userinput>f</userinput></para></entry>
448
<entry><para>Follow by character to move to right of cursor</para></entry>
450
<row><entry><para><userinput>F</userinput></para></entry>
451
<entry><para>Follow by character to move to left of cursor</para></entry>
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>
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>
459
<row><entry><para><userinput>gg</userinput></para></entry>
460
<entry><para>First line</para></entry>
462
<row><entry><para><userinput>G</userinput></para></entry>
463
<entry><para>Last line</para></entry>
465
<row><entry><para><userinput>w</userinput></para></entry>
466
<entry><para>Next Word</para></entry>
468
<row><entry><para><userinput>W</userinput></para></entry>
469
<entry><para>Next word separated by whitespace</para></entry>
471
<row><entry><para><userinput>b</userinput></para></entry>
472
<entry><para>Previous word</para></entry>
474
<row><entry><para><userinput>B</userinput></para></entry>
475
<entry><para>Previous word separated by whitespace</para></entry>
477
<row><entry><para><userinput>e</userinput></para></entry>
478
<entry><para>End of word</para></entry>
480
<row><entry><para><userinput>E</userinput></para></entry>
481
<entry><para>End of word separated by whitespace</para></entry>
483
<row><entry><para><userinput>ge</userinput></para></entry>
484
<entry><para>End of previous word</para></entry>
486
<row><entry><para><userinput>gE</userinput></para></entry>
487
<entry><para>End of previous word separated by whitespace</para></entry>
489
<row><entry><para><userinput>|</userinput></para></entry>
490
<entry><para>Follow by a column number to move to that column</para></entry>
492
<row><entry><para><userinput>%</userinput></para></entry>
493
<entry><para>Follow by an item to move to that item<!--needs explanation--></para></entry>
495
<row><entry><para><userinput>`</userinput></para></entry>
496
<entry><para>Mark</para></entry>
498
<row><entry><para><userinput>‘</userinput></para></entry>
499
<entry><para>First non-whitespace character of the line the mark is on</para></entry>
501
<row><entry><para><userinput>[[</userinput></para></entry>
502
<entry><para>Previous opening bracket</para></entry>
504
<row><entry><para><userinput>]]</userinput></para></entry>
505
<entry><para>Next opening bracket</para></entry>
507
<row><entry><para><userinput>[]</userinput></para></entry>
508
<entry><para>Previous closing bracket</para></entry>
510
<row><entry><para><userinput>][</userinput></para></entry>
511
<entry><para>Next closing bracket</para></entry>
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>
532
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>Right</keycap></keycombo></para></entry>
533
<entry><para>Move one word right</para></entry>
540
<sect2 id="vi-supported-text-objects">
541
<title>Supported text objects</title>
543
<para>These may be used to select certain portions of a document.</para>
549
<entry><para>Key</para></entry>
550
<entry><para>Command</para></entry>
554
<row><entry><para><userinput>iw</userinput></para></entry>
555
<entry><para>Inner word: word including whitespace</para></entry>
557
<row><entry><para><userinput>aw</userinput></para></entry>
558
<entry><para>A word: word excluding whitespace</para></entry>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
600
<row><entry><para><userinput>i<</userinput></para></entry>
601
<entry><para>Previous opening angle bracket (<userinput><</userinput>) to next closing
602
angle bracket (<userinput>></userinput>), including the brackets</para></entry>
604
<row><entry><para><userinput>a<</userinput></para></entry>
605
<entry><para>Previous opening angle bracket (<userinput><</userinput>) to next closing
606
square bracket (<userinput>></userinput>), excluding the brackets</para></entry>
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>
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>
621
<sect2 id="vi-insert-mode-commands">
622
<title>Supported insert mode commands</title>
628
<entry><para>Key</para></entry>
629
<entry><para>Command</para></entry>
633
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>D</keycap></keycombo></para></entry>
634
<entry><para>Unindent</para></entry>
636
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>T</keycap></keycombo></para></entry>
637
<entry><para>Indent</para></entry>
639
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>E</keycap></keycombo></para></entry>
640
<entry><para>Insert from below</para></entry>
642
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>Y</keycap></keycombo></para></entry>
643
<entry><para>Delete word</para></entry>
645
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>W</keycap></keycombo></para></entry>
646
<entry><para>Delete word</para></entry>
648
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>U</keycap></keycombo></para></entry>
649
<entry><para>Delete line</para></entry>
651
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>J</keycap></keycombo></para></entry>
652
<entry><para>New line</para></entry>
654
<row><entry><para><keycombo action="simul">&Ctrl;<keycap>H</keycap></keycombo></para></entry>
655
<entry><para>Delete char backward</para></entry>
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>
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>
675
<sect2 id="vi-text-object">
676
<title>The Comma Text Object</title>
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>
684
<screenshot id="screenshot-resources">
685
<screeninfo>An example of Comma Text Object</screeninfo>
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 ⪚
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>
700
<sect2 id="vi-missing-features">
701
<title>Missing Features</title>
703
<para>As stated earlier, the goal of &kappname;’s VI Mode is not to support 100% of
704
Vim’s features.</para>