Common vi commands

Written by Tully on May 11, 2009 Categories: Linux Tags: , , ,

dw – Deletes the
word that comes immediately after the cursor, including the space following the
word. The text is saved in a memory buffer.

de – Deletes the
word that comes immediately after the cursor, not including the space. The text
is saved in a memory buffer.

d$ – Deletes from
the insertion point to the end of the line. The text is saved in a memory
buffer.

dd – Deletes the
entire current line. The text is saved in a memory buffer.

p - Inserts the
text deleted in the last deletion operation after the current cursor location.

u - Undoes the
last action.

CTRL-G - Displays
a status line at the bottom of the interface. This displays the name of the
file, the total number of lines in the file, and the current cursor location.

/search_term -
Searches for the next instance of the term specified. For example, entering /init searches for the next instance of
the text “init” after the cursor. Pressing N
after executing a search will search for the next instance of the search
term.

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>