CLI Usage
Basic System Configuration Guide 37
• Searching for Text or Characters
• Manipulating Character/Line Formatting
• Saving and Quitting
• Miscellaneous
Table 11: Cutting and Pasting/Deleting Text in vi
vi
Command
Description
" Specify a buffer to be used any of the commands using buffers. Follow the
" character with a letter or a number, which corresponds to a buffer.
d Delete text. dd deletes the current line. A count deletes that many lines.
Whatever is deleted is placed into the buffer specified with the "
command. If no buffer is specified, then the general buffer is used.
D Delete to the end of the line from the current cursor position.
p Paste the specified buffer after the current cursor position or line. If no
buffer is specified (with the " command.) then 'p' uses the general buffer.
P Paste the specified buffer before the current cursor position or line. If no
buffer is specified (with the " command.) then P uses the general buffer.
x Delete character under the cursor. A count tells how many characters to
delete. The characters will be deleted after the cursor.
X Delete the character before the cursor.
y Yank text, putting the result into a buffer. yy yanks the current line.
Entering a number yanks that many lines. The buffer can be specified with
the " command. If no buffer is specified, then the general buffer is used.
Y Yank the current line into the specified buffer. If no buffer is specified,
then the general buffer is used.
Table 12: Inserting New Text
vi
Command
Description
A Append at the end of the current line.
I Insert from the beginning of a line.
O Enter insert mode in a new line above the current cursor position.