Ex command ranges
Many ex commands accept a range of lines to operate upon. The range precede the command name and consists of zero, one or two line addresses separated with comma.
A line address can be written as:
- an absolute line number, ie 3
- $ denotes the last line
- . (a dot) referes to the current line
- a mark (eg 'x)
- % denotes all lines, same as 1,$
- a forward search pattern, delimited by slashes, eg /foo/
- a backward search pattern, delimited by question marks, eg ?foo?
Additionally, a line offset may be appended to a line address with + or -. For example, .+2 means two lines after the current line.