The article mentions ”gn” in passing, but it doesn’t give it enough credit: this is an enormously useful motion, almost more useful on its own than the rest of the article.
The thing that makes it golden is that it is a motion, and thus combined with a command, it is repeatable! So, like:
1. Search for something (either using / or *).
2. Type ”cgn” in Normal mode (i.e. change next search match) and replace what you searched for with whatever
3. Hammer on ”.” (i.e. repeat last command) to replace other matches.
This replaces, like, 97% of uses of :s and is a much more convenient way to do search/replace, especially if you use * to search for the word under the cursor. It’s the bee’s knees!
The thing that makes it golden is that it is a motion, and thus combined with a command, it is repeatable! So, like:
1. Search for something (either using / or *).
2. Type ”cgn” in Normal mode (i.e. change next search match) and replace what you searched for with whatever
3. Hammer on ”.” (i.e. repeat last command) to replace other matches.
This replaces, like, 97% of uses of :s and is a much more convenient way to do search/replace, especially if you use * to search for the word under the cursor. It’s the bee’s knees!