vim Command-line ranges Line offsets


Example

Line offsets can be used to adjust the start and end lines:

:/foo/-,/bar/+4command    " from the line above next 'foo' to 4 lines below next 'bar'

See :help search-offset.