After reading about Vim regex
s, my head hurts.
I'd like to change all words ending in _bar
into words starting with bar_
.
So for example:
var variable_foo = "foo",
more_foo = "foo";
would become:
var foo_variable = "foo",
foo_more = "foo"; // New variable names
I know the answer will involve :%s/<something>/<something else>/g
.
The answer should be robust to coding-style word boundaries like this:
(inside_parens_foo)
changes to
(foo_inside_parens)