October 2015
Intermediate to advanced
356 pages
7h 54m
English
| Tip 29 | Duplicate or Move Lines Using ‘:t’ and ‘:m’ Commands |
The :copy command (and its shorthand :t) lets us duplicate one or more lines from one part of the document to another, while the :move command lets us place them somewhere else in the document.
For demonstration purposes, we’ll use this shopping list:
| | Shopping list |
| | Hardware Store |
| | Buy new hammer |
| | Beauty Parlor |
| | Buy nail polish remover |
| | Buy nails |
Our shopping list is incomplete: we also need to buy nails at the hardware store. To fix the list, we’ll reuse the last line of the file, creating a copy of it below “Hardware Store.” We can easily do so using the :copy Ex command:
| Keystrokes | Buffer Contents |
|---|---|
{start} ... |