Open DarkDust opened 12 years ago
Just as note, Actually I tried this to work correctly but it was a little complex. I know Vim does it but replacing each line without 'g' is not easy problem despite it looks easy. ( Consider if the pattern include '\n' to be replaced )
I hope someone here is good at such a little complex string processing...
Recipe: Say you've got a text of 10 lines, each containing the word "foo" somewhere. Now enter
:2,6s/foo/bar/
Expected result: In each of the lines 2–6 the first occurrence of
foo
should be changed tobar
.What's happening: Only the first
foo
is changed tobar
, all remaining lines are not changed.Using
:2,6s/foo/bar/g
works as expected and replaces allfoo
s in lines 2–6.Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.