October 2012
346 pages
7h 40m
English
| Tip 66 | Play Back with a Count |
The Dot Formula can be an efficient editing strategy for a small number of repeats, but it can’t be executed with a count. Overcome this limitation by recording a cheap one-off macro and playing it back with a count.
In Tip 3, we used the Dot Formula to transform this:
| the_vim_way/3_concat.js | |
| | var foo = "method("+argument1+","+argument2+")"; |
What we want is for it to look like this:
| | var foo = "method(" + argument1 + "," + argument2 + ")"; |
The Dot Formula meant that we could complete the task simply by repeating ;. a few times. What if we faced the same problem but on a larger scale?
| | x = "("+a+","+b+","+c+","+d+","+e+")"; |
We can approach this in exactly the same way. But when ...
Read now
Unlock full access