Reputation: 1633
How do I replace vector
with std::vector
if and only if vector
is not already preceded by std::
? I could maybe come up with a convoluted way of doing it but I want something simple.
Upvotes: 1
Views: 106
Reputation: 20516
Using negative lookbehind. This will replace vector
with std::vector
if and only if vector
is not already preceded by std::
:%s/\v(std::)@<!vector/std::vector/g
Upvotes: 4