News for hackers. Stuff that matters.
Re:Vim Clutch – A hardware pedal for improved text editing (... by Lio on Friday March 12, 2021 @05:37AM (#26434228)
Personally, if my cursor was on the "foo" I'd probably use:

  *gcn<bar>.
That is:

  * (highlight all occurrences of foo)
  gcn (globally changes the highlighted pattern)
  <bar> (the text you want to replace with)
  . (repeat the command as many times as you want).

If you know you want to change all the occurrences at once you can highlight "foo" with * (shift-8) and then use :%s//bar/g as it will be set as the last regexp.

There are no comments on this comment yet.