Zipping Through Repetitive Editing

The preceding chapter covered the mechanics of using vi. This chapter shows how vi uses the tools from that chapter to automate almost any situation in which, in other editors, you would have to manually enter the same set of keystrokes (or worse, mouse drags) over and over again.

Using . to Repeat an Edit

The period (.) command repeats the last insert, delete, or modification but applies it to the current cursor position. The catch is, it repeats only the very last change. Assume, for example, that you are composing a letter and want to change a three-word company name (such as Acme Computer Products) to some other name repeatedly. If you first delete the old three-word name, then insert the new name, and ...

Get Practical UNIX now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.