October 2015
Intermediate to advanced
356 pages
7h 54m
English
| Tip 11 | Don’t Count If You Can Repeat |
We can minimize the keystrokes required to perform certain tasks by providing a count, but that doesn’t mean that we should. Consider the pros and cons of counting versus repeating.
Suppose that we had the following text in our buffer:
| | Delete more than one word |
We want to do as the text says, changing it to read “Delete one word” instead. That is to say, we’re going to delete two words.
We can approach this in a handful of ways. Both d2w and 2dw will work. With d2w, we invoke the delete command and then give 2w as the motion. We could read that as “delete two words.” However, 2dw turns things around. This time the count applies to the delete command, but the motion acts over a single word. We could ...