I know there is one way to search and replace variable occurrences across a source file.
But is there any better way by which if I rename a variable at one place it gets renamed at other places as well without search and replace or substitute?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
You can just use the usual workflow
/original cwreplaced n.n.
You can take also advantage of the
/original<CR> cgnreplaced<ESC> .....
next matched pattern, so instead of using
go to next and
repeat you can just
.. which means
gn means "search for next occurence and start a visual selection over it", you can read more about it on the doc: