October 2012
346 pages
7h 40m
English
| Tip 92 | Repeat the Previous Substitute Command |
At times, we might have to amend the range of a substitute command. We might have made a mistake on our first try, or maybe we just want to rerun the command exactly but on a different buffer. A couple of shortcuts make it easy to repeat the substitute command.
Suppose that we’ve just executed this command, which acts upon the current line:
| => | :s/target/replacement/g |
We realize our mistake at once: we should have prepended %. No harm done. We can repeat the command across the entire file just by pressing g& (see g&
), which is equivalent to ...
Read now
Unlock full access