Skip to Content
Learning the vi and Vim Editors, 7th Edition
book

Learning the vi and Vim Editors, 7th Edition

by Arnold Robbins, Elbert Hannah, Linda Lamb
July 2008
Beginner
492 pages
16h
English
O'Reilly Media, Inc.
Content preview from Learning the vi and Vim Editors, 7th Edition

Review of Basic vi Commands

Table 2-1 presents a few of the commands you can perform by combining the commands c, d, and y with various text objects. The last two rows show additional commands for editing. Tables 2-2 and 2-3 list some other basic commands. Table 2-4 summarizes the rest of the commands described in this chapter.

Table 2-1. Edit commands
Text objectChangeDeleteCopy
One wordcwdwyw

Two words, not counting punctuation

2cW or c2W2dW or d2W2yW or y2W
Three words back3cb or c3b3db or d3b3yb or y3b
One lineccddyy or Y
To end of linec$ or Cd$ or Dy$
To beginning of linec0d0y0
Single characterrx or Xyl or yh
Five characters5s5x5yl
Table 2-2. Movement
MovementCommands
, , ,

h, j, k, l

To first character of next line+
To first character of previous line-
To end of worde or E
Forward by wordw or W
Backward by wordb or B
To end of line$
To beginning of line0
Table 2-3. Other operations
OperationsCommands
Place text from bufferP or p
Start vi, open file if specifiedvi file
Save edits, quit fileZZ
No saving of edits, quit file:q!
Table 2-4. Text creation and manipulation commands
Editing actionCommand
Insert text at current positioni
Insert text at beginning of lineI
Append text at current positiona
Append text at beginning of lineA
Open new line below cursor for new texto
Open new line above cursor for new textO
Delete line and substitute textS
Overstrike existing characters with new textR
Join current and next lineJ
Toggle case~
Repeat last action.
Undo last changeu
Restore line to original stateU

You can get by ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning the vi and Vim Editors, 8th Edition

Learning the vi and Vim Editors, 8th Edition

Arnold Robbins, Elbert Hannah
Vim Masterclass

Vim Masterclass

Jason Cannon
Mastering Vim

Mastering Vim

Ruslan Osipov

Publisher Resources

ISBN: 9780596529833Errata Page