Assume buffer content:
aa bb
yy xx
aa bb
What's the different between /xx
and :/xx
?
Assume buffer content:
aa bb
yy xx
aa bb
What's the different between /xx
and :/xx
?
/xx
place cursor at xx
, it's a :h / .
:/xx
is a :h :[range] , not :h :range , it's a valid ex command by itself, it's behavior is affected by :h 'startofline' .
If 'startofline'
is on (default), :/xx
place cursor at 1st non-blank of the line that contain xx
, it's the leading y
in this case.
If 'startofline'
is off, :/xx
move cursor to the matching line without moving the column if possible (you have to move the column if target line is too short).