Is there a way to specify search and replace range using the current line as a reference? I can specify range using explicit line numbers like
:5,15s/foo/bar/g
<
You can use .
for the current position, and .+10
for 10 lines down:
:.,.+10s/foo/bar/g
Some other useful ranges:
%
for the whole file.'<,'>
for the lines of visually selected block. This might get you more than you want of the visual selection starts or ends in the middle of a line. The whole line is included.'a,'b
from mark a to mark b..,$
from the current line to the end of the file.