Warning, /utilities/kate/doc/katepart/vi.docbook is written in an unsupported language. File is not indexed.

0001 <!--pulled in by kwrite too-->
0002 <chapter id="vi-input-mode-chapter">
0003 <chapterinfo>
0004 <authorgroup><author>
0005 &Erlend.Hamberg; &Erlend.Hamberg.mail;
0006 </author>
0007 <!-- TRANS:ROLES_OF_TRANSLATORS -->
0008 </authorgroup>
0009 </chapterinfo>
0010 
0011 <title>The VI Input Mode</title>
0012 
0013 <sect1 id="vi-mode-sect1">
0014 <title>VI Input Mode</title>
0015 
0016 <para>The goal of the VI mode is not to be a complete replacement
0017 for Vim and support all Vim’s features. Its aim is to make
0018 the <quote>Vim way</quote> of text editing - and the Vim habits learned -
0019 available for programs using the &kappname; text editor as their internal editor.</para>
0020 
0021 <para>The VI mode aims to integrate nicely with the program and deviate
0022 from Vim’s behavior where it makes sense. For example,
0023 <userinput><command>:w</command></userinput> will open a save dialog in &kappname;’s VI mode.</para>
0024 
0025 <para>To enable the VI Input Mode for all new views, go to
0026 <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kappname;...</guimenuitem>
0027 <guimenu>Editing</guimenu><guimenuitem>VI Input Mode</guimenuitem></menuchoice>.
0028 On this tab you can set options for the VI Input Mode and define and edit
0029 the key mapping in this mode.
0030 VI Input Mode can also be toggled with the <guimenuitem>VI Input Mode</guimenuitem>
0031 setting in the <guimenu>Edit</guimenu> menu. (The default shortcut key is
0032 <keycombo action="simul">&Meta;&Ctrl;<keycap>V</keycap></keycombo>
0033  - where &Meta; usually is the <keysym>Windows</keysym> key).</para>
0034 
0035 <note>
0036 <para>Many Vi Mode keyboard commands are case-sensitive, unlike most &kde;
0037 keyboard shortcuts.  That means that <userinput>y</userinput> and
0038 <userinput>Y</userinput> are different commands.  To enter the
0039 <userinput>y</userinput> (yank) command, make sure <keysym>Caps Lock</keysym> is
0040 disabled and press <keycap>Y</keycap>.  To enter the <userinput>Y</userinput>
0041 (yank to end of line) command,
0042 <keycombo action="simul">&Shift;<keycap>Y</keycap></keycombo>.</para>
0043 
0044 <para>This does not apply to commands that use the &Ctrl; key, which may be
0045 entered regardless of <keycap>Caps Lock</keycap> mode and without pressing
0046 &Shift;.  However, some commands require the use of a &Ctrl;-key combination
0047 followed by another key which is case sensitive.  For instance, to input
0048 <quote><keycombo action="simul">&Ctrl;<keycap>W</keycap></keycombo>,
0049 <userinput>h</userinput></quote> (switch to split view right) make sure
0050 <keycap>Caps Lock</keycap> is disabled, press
0051 <keycombo action="simul">&Ctrl;<keycap>W</keycap></keycombo>, release, and
0052 then press <keycap>H</keycap>.</para>
0053 </note>
0054 
0055 <sect2 id="vi-incompatibilities">
0056 <title>Incompatibilities with Vim</title>
0057 
0058 <para>There are only a few features of &kappname;’s VI mode which are incompatible
0059 with Vim (not counting things missing). They are listed below together
0060 with the respective reasons.</para>
0061 <itemizedlist>
0062 <listitem>
0063 <para>&kappname;: <userinput>U</userinput> and
0064 <keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo> is redo.</para>
0065 <para>Vim: <keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo> is
0066 normal redo, <keycap>U</keycap> is used to undo all latest changes on one line.</para>
0067 <para>The reason for having <keycap>U</keycap> act as redo in &kappname;’s VI mode is
0068 that the shortcut <keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo>
0069 by default is taken by &kappname;’s replace function (search and replace). By default,
0070 the VI mode won’t override &kappname;’s shortcuts (this can be configured in
0071 <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kappname;...</guimenuitem>
0072 <guimenu>Editing</guimenu><guimenuitem>Vi Input Mode</guimenuitem></menuchoice>),
0073 therefore a redo-action needs to be available as a <quote>regular</quote> key press, too.
0074 Besides, the behavior of the <userinput>U</userinput> command in Vim does not map well
0075 to &kappname;’s internal undo system, so it would be non-trivial to support anyway.</para>
0076 </listitem>
0077 <listitem>
0078 <para>&kappname;: <userinput><command>print</command></userinput> shows the <guilabel>Print</guilabel> dialog.</para>
0079 <para>Vim: <userinput><command>print</command></userinput> prints the lines of
0080 the given range like its grandfather ed.</para>
0081 <para>Commands like <userinput><command>:print</command></userinput> are available
0082 not only in the VI mode but for users using <quote>regular</quote> &kappname;, too - therefore
0083 the <userinput><command>:print</command></userinput> command opens
0084 the print dialog - following the principle of least surprise instead of
0085 mimicking Vim’s behavior.</para>
0086 </listitem>
0087 <listitem>
0088 <para>&kappname;: <userinput>Y</userinput> yanks to end of line.</para>
0089 <para>Vim: <userinput>Y</userinput> yanks whole line, just like
0090 <userinput>y</userinput><userinput>y</userinput>.</para>
0091 <para>VI’s behavior for the <userinput>Y</userinput> command is in practice a bug.
0092 For both change and delete commands,
0093 <userinput>c</userinput><userinput>c</userinput>/
0094 <userinput>d</userinput><userinput>d</userinput> will do its action on
0095 the current line and <userinput>C</userinput>/<userinput>D</userinput> will work from the
0096 cursor column to the end of the line. However, both
0097 <userinput>y</userinput><userinput>y</userinput> and <userinput>Y</userinput>
0098 yanks the current line. In &kappname;’s VI Mode <userinput>Y</userinput> will yank to the end
0099 of the line. This is described as <quote>more logical</quote> in the Vim
0100 <ulink url="http://vimdoc.sourceforge.net/htmldoc/change.html#Y">documentation</ulink>.
0101 </para>
0102 </listitem>
0103 <listitem>
0104 <para>&kappname;: <userinput>O</userinput> and <userinput>o</userinput> opens [<replaceable>count</replaceable>] new lines
0105 and puts you in insert mode.</para>
0106 <para>Vim: <userinput>O</userinput> and <userinput>o</userinput> opens a new line and inserts
0107 text [<replaceable>count</replaceable>] times when leaving insert mode.</para>
0108 <para>This is mostly done as a consequence of witnessing many people being
0109 confused by this behavior on a vim &irc; channel (#vim on Libera Chat).</para>
0110 </listitem>
0111 </itemizedlist>
0112 
0113 </sect2>
0114 
0115 <sect2 id="vi-switching-modes">
0116 <title>Switching Modes</title>
0117 
0118 <itemizedlist>
0119 <listitem>
0120 <para><emphasis>Normal Mode</emphasis> permits you to enter commands to navigate or edit
0121 a document, and is the default mode.  You can return to it from any other mode by
0122 pressing &Esc;.
0123 </para></listitem>
0124 <listitem>
0125 <para><emphasis>Visual Mode</emphasis> permits you to highlight text in a document.
0126 Most Normal Mode commands are also valid in this mode.  You can enter it by pressing
0127 <userinput>v</userinput> to select characters or <userinput>V</userinput> to select lines.
0128 </para></listitem>
0129 <listitem>
0130 <para><emphasis>Insert Mode</emphasis> permits you to edit the document directly. You
0131 can enter it by pressing <userinput>i</userinput> or one of several other commands
0132 listed below.
0133 </para></listitem>
0134 <listitem>
0135 <para><emphasis>Command Mode</emphasis> invokes &kappname;'s command line,
0136 permitting you to run many commands available in Vi implementations as well as
0137 some specific to &kappname;.  For more information on these commands, see
0138 <xref linkend="advanced-editing-tools-commandline" />.  To use it,
0139 press <keycap>:</keycap>, enter the command, and press &Enter;.</para>
0140 </listitem>
0141 </itemizedlist>
0142 <!-- add a picture like https://de.wikipedia.org/wiki/Vi#Arbeitsmodi here? -->
0143 </sect2>
0144 
0145 <sect2 id="vi-integration">
0146 <title>Integration with &kate; features</title>
0147 <itemizedlist>
0148 
0149 <listitem>
0150 <para>Visual Mode is entered automatically when text is selected with the mouse.
0151 It is also entered when using functions of &kate; that select text, such as Select
0152 All (either from the menu or via <keycombo action="simul">&Ctrl;<keycap>A</keycap>
0153 </keycombo>.)</para>
0154 </listitem>
0155 
0156 <listitem>
0157 <para>Vi marks and <link linkend="kate-part-bookmarks">&kate; bookmarks</link> are
0158 integrated.  When a mark is created in Vi Mode, a corresponding &kate; bookmark is
0159 created and appears in the <guimenu>Bookmarks</guimenu> menu.  Conversely, when
0160 a &kate; bookmark is created, a corresponding Vi mark at the 0 column is also
0161 created.</para>
0162 </listitem>
0163 
0164 </itemizedlist>
0165 </sect2>
0166 
0167 <sect2 id="vi-normal-visual-mode-commands">
0168 <title>Supported normal/visual mode commands</title>
0169 
0170 <informaltable>
0171 <tgroup cols="2">
0172 <!--thead>
0173 <row>
0174 <entry><para>Key</para></entry>
0175 <entry><para>Command</para></entry>
0176 </row>
0177 </thead-->
0178 <tbody>
0179 <row><entry><para><userinput>a</userinput></para></entry>
0180 <entry><para>Enter Insert Mode; append after cursor</para></entry>
0181 </row>
0182 <row><entry><para><userinput>A</userinput></para></entry>
0183 <entry><para>Enter Insert Mode; append after line</para></entry>
0184 </row>
0185 <row><entry><para><userinput>i</userinput></para></entry>
0186 <entry><para>Enter Insert Mode; insert before cursor</para></entry>
0187 </row>
0188 <row><entry><para>&Ins;</para></entry>
0189 <entry><para>Enter Insert Mode; insert before cursor</para></entry>
0190 </row>
0191 <row><entry><para><userinput>I</userinput></para></entry>
0192 <entry><para>Enter Insert Mode; insert before first non-blank char on line</para></entry>
0193 </row>
0194 <row><entry><para><userinput>gi</userinput></para></entry>
0195 <entry><para>Enter Insert Mode; insert before place, where leaving the last insert mode</para></entry>
0196 </row>
0197 <row><entry><para><userinput>v</userinput></para></entry>
0198 <entry><para>Enter Visual Mode; select characters</para></entry>
0199 </row>
0200 <row><entry><para><userinput>V</userinput></para></entry>
0201 <entry><para>Enter Visual Mode; select lines</para></entry>
0202 </row>
0203 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>v</keycap></keycombo></para></entry>
0204 <entry><para>Enter Visual Mode; select blocks</para></entry>
0205 </row>
0206 <row><entry><para><userinput>gb</userinput></para></entry>
0207 <entry><para>Enter Visual Mode; reselect the last selection</para></entry>
0208 </row>
0209 <row><entry><para><userinput>o</userinput></para></entry>
0210 <entry><para>Open a new line below current line</para></entry>
0211 </row>
0212 <row><entry><para><userinput>O</userinput></para></entry>
0213 <entry><para>Open a new line above current line</para></entry>
0214 </row>
0215 <row><entry><para><userinput>J</userinput></para></entry>
0216 <entry><para>Join lines</para></entry>
0217 </row>
0218 <row><entry><para><userinput>c</userinput></para></entry>
0219 <entry><para>Change:  follow by a motion to delete and enter Insert mode</para></entry>
0220 </row>
0221 <row><entry><para><userinput>C</userinput></para></entry>
0222 <entry><para>Change to end of line:  Delete to end of line and enter Insert Mode</para></entry>
0223 </row>
0224 <row><entry><para><userinput>cc</userinput></para></entry>
0225 <entry><para>Change line:  Delete line and enter Insert Mode</para></entry>
0226 </row>
0227 <row><entry><para><userinput>s</userinput></para></entry>
0228 <entry><para>Substitute character<!--needs explanation--></para></entry>
0229 </row>
0230 <row><entry><para><userinput>S</userinput></para></entry>
0231 <entry><para>Substitute line<!--needs explanation--></para></entry>
0232 </row>
0233 <row><entry><para><userinput>dd</userinput></para></entry>
0234 <entry><para>Delete line</para></entry>
0235 </row>
0236 <row><entry><para><userinput>d</userinput></para></entry>
0237 <entry><para>Follow by a motion to delete</para></entry>
0238 </row>
0239 <row><entry><para><userinput>D</userinput></para></entry>
0240 <entry><para>Delete to end of line</para></entry>
0241 </row>
0242 <row><entry><para><userinput>x</userinput></para></entry>
0243 <entry><para>Delete character to right of cursor</para></entry>
0244 </row>
0245 <row><entry><para>&Del;</para></entry>
0246 <entry><para>Delete character to right of cursor</para></entry>
0247 </row>
0248 <row><entry><para><userinput>X</userinput></para></entry>
0249 <entry><para>Delete character to left of cursor</para></entry>
0250 </row>
0251 <row><entry><para><userinput>gu</userinput></para></entry>
0252 <entry><para>Follow with a motion to make lowercase</para></entry>
0253 </row>
0254 <row><entry><para><userinput>guu</userinput></para></entry>
0255 <entry><para>Make the current line lowercase</para></entry>
0256 </row>
0257 <row><entry><para><userinput>gU</userinput></para></entry>
0258 <entry><para>Follow with a motion to make uppercase</para></entry>
0259 </row>
0260 <row><entry><para><userinput>gUU</userinput></para></entry>
0261 <entry><para>Make the current line uppercase</para></entry>
0262 </row>
0263 <row><entry><para><userinput>y</userinput></para></entry>
0264 <entry><para>Follow by a motion to <quote>yank</quote> (copy)</para></entry>
0265 </row>
0266 <row><entry><para><userinput>yy</userinput></para></entry>
0267 <entry><para>Yank (copy) line</para></entry>
0268 </row>
0269 <row><entry><para><userinput>Y</userinput></para></entry>
0270 <entry><para>Yank (copy) line</para></entry>
0271 </row>
0272 <row><entry><para><userinput>p</userinput></para></entry>
0273 <entry><para>Paste after cursor</para></entry>
0274 </row>
0275 <row><entry><para><userinput>P</userinput></para></entry>
0276 <entry><para>Paste before cursor</para></entry>
0277 </row>
0278 <row><entry><para><userinput>]p</userinput></para></entry>
0279 <entry><para>Paste after cursor indented</para></entry>
0280 </row>
0281 <row><entry><para><userinput>[p</userinput></para></entry>
0282 <entry><para>Paste before cursor indented</para></entry>
0283 </row>
0284 <row><entry><para><userinput>r</userinput></para></entry>
0285 <entry><para>Follow with a character to replace the character after the cursor</para></entry>
0286 </row>
0287 <row><entry><para><userinput>R</userinput></para></entry>
0288 <entry><para>Enter Replace Mode</para></entry>
0289 </row>
0290 <row><entry><para><userinput>:</userinput></para></entry>
0291 <entry><para>Enter Command Mode</para></entry>
0292 </row>
0293 <row><entry><para><userinput>/</userinput></para></entry>
0294 <entry><para>Search</para></entry>
0295 </row>
0296 <row><entry><para><userinput>u</userinput></para></entry>
0297 <entry><para>Undo</para></entry>
0298 </row>
0299 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo></para></entry>
0300 <entry><para>Redo</para></entry>
0301 </row>
0302 <row><entry><para><userinput>U</userinput></para></entry>
0303 <entry><para>Redo</para></entry>
0304 </row>
0305 <row><entry><para><userinput>m</userinput></para></entry>
0306 <entry><para>Set mark (can be used by motions later)</para></entry>
0307 </row>
0308 <row><entry><para><userinput>n</userinput></para></entry>
0309 <entry><para>Find next</para></entry>
0310 </row>
0311 <row><entry><para><userinput>N</userinput></para></entry>
0312 <entry><para>Find previous</para></entry>
0313 </row>
0314 <row><entry><para><userinput>&gt;&gt;</userinput></para></entry>
0315 <entry><para>Indent line</para></entry>
0316 </row>
0317 <row><entry><para><userinput>&lt;&lt;</userinput></para></entry>
0318 <entry><para>Unindent line</para></entry>
0319 </row>
0320 <row><entry><para><userinput>&gt;</userinput></para></entry>
0321 <entry><para>Indent lines</para></entry>
0322 </row>
0323 <row><entry><para><userinput>&lt;</userinput></para></entry>
0324 <entry><para>Unindent lines</para></entry>
0325 </row>
0326 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>F</keycap></keycombo></para></entry>
0327 <entry><para>Page down</para></entry>
0328 </row>
0329 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>B</keycap></keycombo></para></entry>
0330 <entry><para>Page up</para></entry>
0331 </row>
0332 <row><entry><para><userinput>ga</userinput></para></entry>
0333 <entry><para>Print the &ASCII; value of the character</para></entry>
0334 </row>
0335 <row><entry><para><userinput>.</userinput></para></entry>
0336 <entry><para>Repeat last change</para></entry>
0337 </row>
0338 <row><entry><para><userinput>==</userinput></para></entry>
0339 <entry><para>commandAlignLine<!--needs explanation--></para></entry>
0340 </row>
0341 <row><entry><para><userinput>=</userinput></para></entry>
0342 <entry><para>commandAlignLines<!--needs explanation--></para></entry>
0343 </row>
0344 <row><entry><para><userinput>~</userinput></para></entry>
0345 <entry><para>Change case of current character</para></entry>
0346 </row>
0347 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo></para></entry>
0348 <entry><para>Split view horizontally</para></entry>
0349 </row>
0350 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>V</keycap></keycombo></para></entry>
0351 <entry><para>Split view vertically</para></entry>
0352 </row>
0353 <row><entry><para><keycombo action="simul">&Ctrl;
0354 <keycap>W</keycap></keycombo>, <userinput>w</userinput></para></entry>
0355 <entry><para>Cycle to next split window</para></entry>
0356 </row>
0357 <row><entry><para><keycombo action="simul">&Ctrl;
0358 <keycap>W</keycap></keycombo>, <userinput>h</userinput></para>
0359 <para><keycombo action="seq"><keycombo action="simul">&Ctrl;
0360 <keycap>W</keycap></keycombo>&Left;</keycombo></para></entry>
0361 <entry><para>Go to left split window</para></entry>
0362 </row>
0363 <row><entry><para><keycombo action="simul">&Ctrl;
0364 <keycap>W</keycap></keycombo>, <userinput>l</userinput></para>
0365 <para><keycombo action="seq"><keycombo action="simul">&Ctrl;
0366 <keycap>W</keycap></keycombo>&Right;</keycombo></para></entry>
0367 <entry><para>Go to right split window</para></entry>
0368 </row>
0369 <row><entry><para><keycombo action="simul">&Ctrl;
0370 <keycap>W</keycap></keycombo>, <userinput>k</userinput></para>
0371 <para><keycombo action="seq"><keycombo action="simul">&Ctrl;
0372 <keycap>W</keycap></keycombo>&Up;</keycombo></para></entry>
0373 <entry><para>Go to above split window</para></entry>
0374 </row>
0375 <row><entry><para><keycombo action="simul">&Ctrl;
0376 <keycap>W</keycap></keycombo>, <userinput>j</userinput></para>
0377 <para><keycombo action="seq"><keycombo action="simul">&Ctrl;
0378 <keycap>W</keycap></keycombo>&Down;</keycombo></para></entry>
0379 <entry><para>Go to below split window</para></entry>
0380 </row>
0381 </tbody>
0382 </tgroup>
0383 </informaltable>
0384 </sect2>
0385 
0386 <sect2 id="vi-supported-motions">
0387 <title>Supported motions</title>
0388 
0389 <para>These may be used to move around a document in Normal or Visual mode, or in
0390 conjunction with one of the above commands.  They may be preceded by a count,
0391 which indicates how many of the appropriate movements to make.</para>
0392 
0393 <informaltable>
0394 <tgroup cols="2">
0395 <!--thead>
0396 <row>
0397 <entry><para>Key</para></entry>
0398 <entry><para>Command</para></entry>
0399 </row>
0400 </thead-->
0401 <tbody>
0402 <row><entry><para><userinput>h</userinput></para></entry>
0403 <entry><para>Left</para></entry>
0404 </row>
0405 <row><entry><para>&Left;</para></entry>
0406 <entry><para>Left</para></entry>
0407 </row>
0408 <row><entry><para>&Backspace;</para></entry>
0409 <entry><para>Left</para></entry>
0410 </row>
0411 <row><entry><para><userinput>j</userinput></para></entry>
0412 <entry><para>Down</para></entry>
0413 </row>
0414 <row><entry><para>&Down;</para></entry>
0415 <entry><para>Down</para></entry>
0416 </row>
0417 <row><entry><para><userinput>k</userinput></para></entry>
0418 <entry><para>Up</para></entry>
0419 </row>
0420 <row><entry><para>&Up;</para></entry>
0421 <entry><para>Up</para></entry>
0422 </row>
0423 <row><entry><para><userinput>l</userinput></para></entry>
0424 <entry><para>Right</para></entry>
0425 </row>
0426 <row><entry><para>&Right;</para></entry>
0427 <entry><para>Right</para></entry>
0428 </row>
0429 <row><entry><para>&Space;</para></entry>
0430 <entry><para>Right</para></entry>
0431 </row>
0432 <row><entry><para><userinput>$</userinput></para></entry>
0433 <entry><para>End of line</para></entry>
0434 </row>
0435 <row><entry><para>&End;</para></entry>
0436 <entry><para>End of line</para></entry>
0437 </row>
0438 <row><entry><para><userinput>0</userinput></para></entry>
0439 <entry><para>First character of line (Column 0)</para></entry>
0440 </row>
0441 <row><entry><para>&Home;</para></entry>
0442 <entry><para>First character of line</para></entry>
0443 </row>
0444 <row><entry><para><userinput>^</userinput></para></entry>
0445 <entry><para>First non-blank character of line</para></entry>
0446 </row>
0447 <row><entry><para><userinput>f</userinput></para></entry>
0448 <entry><para>Follow by character to move to right of cursor</para></entry>
0449 </row>
0450 <row><entry><para><userinput>F</userinput></para></entry>
0451 <entry><para>Follow by character to move to left of cursor</para></entry>
0452 </row>
0453 <row><entry><para><userinput>t</userinput></para></entry>
0454 <entry><para>Follow by character to move to right of cursor, placing the cursor on character before it</para></entry>
0455 </row>
0456 <row><entry><para><userinput>T</userinput></para></entry>
0457 <entry><para>Follow by character to move to left of cursor, placing the cursor on character before it</para></entry>
0458 </row>
0459 <row><entry><para><userinput>gg</userinput></para></entry>
0460 <entry><para>First line</para></entry>
0461 </row>
0462 <row><entry><para><userinput>G</userinput></para></entry>
0463 <entry><para>Last line</para></entry>
0464 </row>
0465 <row><entry><para><userinput>w</userinput></para></entry>
0466 <entry><para>Next Word</para></entry>
0467 </row>
0468 <row><entry><para><userinput>W</userinput></para></entry>
0469 <entry><para>Next word separated by whitespace</para></entry>
0470 </row>
0471 <row><entry><para><userinput>b</userinput></para></entry>
0472 <entry><para>Previous word</para></entry>
0473 </row>
0474 <row><entry><para><userinput>B</userinput></para></entry>
0475 <entry><para>Previous word separated by whitespace</para></entry>
0476 </row>
0477 <row><entry><para><userinput>e</userinput></para></entry>
0478 <entry><para>End of word</para></entry>
0479 </row>
0480 <row><entry><para><userinput>E</userinput></para></entry>
0481 <entry><para>End of word separated by whitespace</para></entry>
0482 </row>
0483 <row><entry><para><userinput>ge</userinput></para></entry>
0484 <entry><para>End of previous word</para></entry>
0485 </row>
0486 <row><entry><para><userinput>gE</userinput></para></entry>
0487 <entry><para>End of previous word separated by whitespace</para></entry>
0488 </row>
0489 <row><entry><para><userinput>|</userinput></para></entry>
0490 <entry><para>Follow by a column number to move to that column</para></entry>
0491 </row>
0492 <row><entry><para><userinput>%</userinput></para></entry>
0493 <entry><para>Follow by an item to move to that item<!--needs explanation--></para></entry>
0494 </row>
0495 <row><entry><para><userinput>`</userinput></para></entry>
0496 <entry><para>Mark</para></entry>
0497 </row>
0498 <row><entry><para><userinput>‘</userinput></para></entry>
0499 <entry><para>First non-whitespace character of the line the mark is on</para></entry>
0500 </row>
0501 <row><entry><para><userinput>[[</userinput></para></entry>
0502 <entry><para>Previous opening bracket</para></entry>
0503 </row>
0504 <row><entry><para><userinput>]]</userinput></para></entry>
0505 <entry><para>Next opening bracket</para></entry>
0506 </row>
0507 <row><entry><para><userinput>[]</userinput></para></entry>
0508 <entry><para>Previous closing bracket</para></entry>
0509 </row>
0510 <row><entry><para><userinput>][</userinput></para></entry>
0511 <entry><para>Next closing bracket</para></entry>
0512 </row>
0513 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>I</keycap></keycombo></para></entry>
0514 <entry><para>Jump to next location</para></entry></row>
0515 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>O</keycap></keycombo></para></entry>
0516 <entry><para>Jump to previous location</para></entry></row>
0517 <row><entry><para><userinput>H</userinput></para></entry>
0518 <entry>Go to first line of screen</entry></row>
0519 <row><entry><para><userinput>M</userinput></para></entry>
0520 <entry>Go to middle line of screen</entry></row>
0521 <row><entry><para><userinput>L</userinput></para></entry>
0522 <entry>Go to last line of screen</entry></row>
0523 <row><entry><para><userinput>%<replaceable>percentage</replaceable></userinput></para></entry>
0524 <entry><para>Go to specified percentage of the document</para></entry></row>
0525 <row><entry><para><userinput>gk</userinput></para></entry>
0526 <entry><para>Go one line up visually (when using dynamic word wrap)</para></entry></row>
0527 <row><entry><para><userinput>gj</userinput></para></entry>
0528 <entry><para>Go one line down visually (when using dynamic word wrap)</para></entry></row>
0529 <row><entry><para><keycombo action="simul">&Ctrl;&Left;</keycombo></para></entry>
0530 <entry><para>Move one word left</para></entry>
0531 </row>
0532 <row><entry><para><keycombo action="simul">&Ctrl;&Right;</keycombo></para></entry>
0533 <entry><para>Move one word right</para></entry>
0534 </row>
0535 </tbody>
0536 </tgroup>
0537 </informaltable>
0538 </sect2>
0539 
0540 <sect2 id="vi-supported-text-objects">
0541 <title>Supported text objects</title>
0542 
0543 <para>These may be used to select certain portions of a document.</para>
0544 
0545 <informaltable>
0546 <tgroup cols="2">
0547 <!--thead>
0548 <row>
0549 <entry><para>Key</para></entry>
0550 <entry><para>Command</para></entry>
0551 </row>
0552 </thead-->
0553 <tbody>
0554 <row><entry><para><userinput>iw</userinput></para></entry>
0555 <entry><para>Inner word: word including whitespace</para></entry>
0556 </row>
0557 <row><entry><para><userinput>aw</userinput></para></entry>
0558 <entry><para>A word: word excluding whitespace</para></entry>
0559 </row>
0560 <row><entry><para><userinput>i"</userinput></para></entry>
0561 <entry><para>Previous double-quote (<userinput>"</userinput>) to next double-quote,
0562 including quotation marks</para></entry>
0563 </row>
0564 <row><entry><para><userinput>a”</userinput></para></entry>
0565 <entry><para>Previous double-quote (<userinput>"</userinput>) to next double-quote,
0566 excluding quotation marks</para></entry>
0567 </row>
0568 <row><entry><para><userinput>i'</userinput></para></entry>
0569 <entry><para>Previous single-quote (<userinput>'</userinput>) to next single-quote,
0570 including quotation marks</para></entry>
0571 </row>
0572 <row><entry><para><userinput>a'</userinput></para></entry>
0573 <entry><para>Previous single-quote (<userinput>'</userinput>) to next single-quote,
0574 excluding quotation marks</para></entry>
0575 </row>
0576 <row><entry><para><userinput>i(</userinput></para></entry>
0577 <entry><para>Previous opening parenthesis [<userinput>(</userinput>] to next closing
0578 parenthesis [<userinput>)</userinput>], including the parenthesis</para></entry>
0579 </row>
0580 <row><entry><para><userinput>a(</userinput></para></entry>
0581 <entry><para>Previous opening parenthesis [<userinput>(</userinput>] to next closing
0582 parenthesis [<userinput>)</userinput>], excluding the parenthesis</para></entry>
0583 </row>
0584 <row><entry><para><userinput>i[</userinput></para></entry>
0585 <entry><para>Previous opening square bracket (<userinput>[</userinput>) to next closing
0586 square bracket (<userinput>]</userinput>), including the brackets</para></entry>
0587 </row>
0588 <row><entry><para><userinput>a[</userinput></para></entry>
0589 <entry><para>Previous opening square bracket (<userinput>[</userinput>) to next closing
0590 square bracket (<userinput>]</userinput>), excluding the brackets</para></entry>
0591 </row>
0592 <row><entry><para><userinput>i{</userinput></para></entry>
0593 <entry><para>Previous opening curly bracket (<userinput>{</userinput>) to next closing
0594 curly bracket (<userinput>}</userinput>), including the brackets</para></entry>
0595 </row>
0596 <row><entry><para><userinput>a{</userinput></para></entry>
0597 <entry><para>Previous opening curly bracket (<userinput>{</userinput>) to next closing
0598 curly bracket (<userinput>}</userinput>), excluding the brackets</para></entry>
0599 </row>
0600 <row><entry><para><userinput>i&lt;</userinput></para></entry>
0601 <entry><para>Previous opening angle bracket (<userinput>&lt;</userinput>) to next closing
0602 angle bracket (<userinput>&gt;</userinput>), including the brackets</para></entry>
0603 </row>
0604 <row><entry><para><userinput>a&lt;</userinput></para></entry>
0605 <entry><para>Previous opening angle bracket (<userinput>&lt;</userinput>) to next closing
0606 square bracket (<userinput>&gt;</userinput>), excluding the brackets</para></entry>
0607 </row>
0608 <row><entry><para><userinput>i`</userinput></para></entry>
0609 <entry><para>Previous backtick (<userinput>`</userinput>) to next backtick,
0610 including the backticks</para></entry>
0611 </row>
0612 <row><entry><para><userinput>a`</userinput></para></entry>
0613 <entry><para>Previous backtick (<userinput>`</userinput>) to next backtick,
0614 excluding the backticks</para></entry>
0615 </row>
0616 </tbody>
0617 </tgroup>
0618 </informaltable>
0619 </sect2>
0620 
0621 <sect2 id="vi-insert-mode-commands">
0622 <title>Supported insert mode commands</title>
0623 
0624 <informaltable>
0625 <tgroup cols="2">
0626 <!--thead>
0627 <row>
0628 <entry><para>Key</para></entry>
0629 <entry><para>Command</para></entry>
0630 </row>
0631 </thead-->
0632 <tbody>
0633 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>D</keycap></keycombo></para></entry>
0634 <entry><para>Unindent</para></entry>
0635 </row>
0636 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>T</keycap></keycombo></para></entry>
0637 <entry><para>Indent</para></entry>
0638 </row>
0639 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>E</keycap></keycombo></para></entry>
0640 <entry><para>Insert from below</para></entry>
0641 </row>
0642 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>Y</keycap></keycombo></para></entry>
0643 <entry><para>Delete word</para></entry>
0644 </row>
0645 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>W</keycap></keycombo></para></entry>
0646 <entry><para>Delete word</para></entry>
0647 </row>
0648 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>U</keycap></keycombo></para></entry>
0649 <entry><para>Delete line</para></entry>
0650 </row>
0651 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>J</keycap></keycombo></para></entry>
0652 <entry><para>New line</para></entry>
0653 </row>
0654 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>H</keycap></keycombo></para></entry>
0655 <entry><para>Delete char backward</para></entry>
0656 </row>
0657 <row><entry><para><keycombo action="simul">&Ctrl;&Home;</keycombo></para></entry>
0658 <entry><para>Move to first character in the document</para></entry>
0659 </row>
0660 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo>
0661 <userinput>n</userinput></para></entry>
0662 <entry>Insert the contents of register <literal>n</literal></entry></row>
0663 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>O</keycap></keycombo>,
0664 <replaceable>command</replaceable></para></entry>
0665 <entry><para>Enter normal mode for one command only</para></entry></row>
0666 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>A</keycap></keycombo></para></entry>
0667 <entry><para>Increment currently selected number</para></entry></row>
0668 <row><entry><para><keycombo action="simul">&Ctrl;<keycap>X</keycap></keycombo></para></entry>
0669 <entry><para>Decrement currently selected number</para></entry></row>
0670 </tbody>
0671 </tgroup>
0672 </informaltable>
0673 </sect2>
0674 
0675 <sect2 id="vi-text-object">
0676 <title>The Comma Text Object</title>
0677 
0678 <para>This object is missing in Vim. The comma text object
0679 makes it easy to modify parameter lists in C-like languages and other comma
0680 separated lists. It is basically the area between two commas or between a comma
0681 and a bracket. In the line shown in the illustration, the three
0682 ranges this text object can span are highlighted.</para>
0683 
0684 <screenshot id="screenshot-resources">
0685 <screeninfo>An example of Comma Text Object</screeninfo>
0686 <mediaobject>
0687 <imageobject><imagedata fileref="comma-to.png" format="PNG"/></imageobject>
0688 <textobject><phrase>An example of Comma Text Object</phrase></textobject>
0689 <caption><para>Comma text object ranges. If the cursor is over &eg;
0690 <replaceable>arg2</replaceable>, pressing
0691 <userinput>ci</userinput>, (<quote>change inner comma</quote>)
0692 would delete <replaceable>double arg2</replaceable> and place the cursor between
0693 the two commas in insert mode. A very convenient way to change a function's
0694 parameters.</para></caption>
0695 </mediaobject>
0696 </screenshot>
0697 
0698 </sect2>
0699 
0700 <sect2 id="vi-missing-features">
0701 <title>Missing Features</title>
0702 
0703 <para>As stated earlier, the goal of &kappname;’s VI Mode is not to support 100% of
0704 Vim’s features.</para>
0705 </sect2>
0706 
0707 </sect1>
0708 
0709 </chapter>