Addresses
Most Ex commands can be optionally preceded by either an address or range that the command should operate on. We’re going to talk about addresses in this section. An address is just a line specifier — they’re used to tell Vim “I’m talking about this line”.
Addresses
To specify an address, you prefix the command like so:
:[address]command
If command supports an address, this will cause it to operate on the address you’ve specified.
For example, if you wanted to delete the 10th line in the buffer, you could use:
:10d
The most basic example of an address is a literal line number, like what we’ve done above. But there are various ‘special’ addresses that are well worth remembering. We’re going to look at these in the next section.
In a sentence, addresses can be used to precisely specify lines.
Let’s give it a try in the editor. Work through the checklist below to delete lines 30, 20, and 10. It runs bottom-up on purpose: every deletion shifts the lines below it, so deleting line 30 first keeps the other two addresses honest.