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

More Command Combinations

In Chapter 2, you learned the edit commands c, d, and y, as well as how to combine them with movements and numbers (such as 2cw or 4dd). In Chapter 3, you added many more movement commands to your repertoire. Although the fact that you can combine edit commands with movement is not a new concept to you, Table 4-1 gives you a feel for the many editing options you now have.

Table 4-1. More editing commands
ChangeDeleteCopyFrom cursor to...
cHdHyHTop of screen
cLdLyLBottom of screen
c+d+y+Next line
c5|d5|y5|Column 5 of current line
2c)2d)2y)Second sentence following
c{d{y{Previous paragraph
c/ patternd/ patterny/ patternPattern
cndnynNext pattern
cGdGyGEnd of file
c13Gd13Gy13GLine number 13

Notice how all of the sequences in Table 4-1 follow the general pattern:

(number)(command)(text object)

number is the optional numeric argument. command in this case is one of c, d, or y. text object is a movement command.

The general form of a vi command is discussed in Chapter 2. You may wish to review Tables 2-1 and 2-2 as well.

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