gn: edit match after match
Change, delete or skip each match in turn, and count them.
4 drills
- Change every match with cgn and .: Change every whole-word match of the word under the cursor. Set the pattern with
*, change one match withcgn, then repeat with.. - Change some, skip some: Change the matches the target changes and keep the others. Use
cgnand.to change,nto skip. - Delete every match with dgn: Delete every match of a pattern whose matches differ in length. Search once, then
dgnand.. - Change part of each match (\zs): Change only the value after the key in each match. Use
\zsso the match starts at the value, thencgnand..
The drill editor loads in your browser.