Make search part of an edit
The technique
The match itself stays. c/keep would delete the same text and let you type in its place.
Keys in this lesson
- d/text
- Delete up to a search match. Press Enter after the text.
- c/text
- Change up to a search match.
Before this lesson: Search foundations and operator grammar.
More about this lesson
Delete or change text up to a word you can see, and leave lookalike words alone.
d/pattern then Enter deletes up to the next match and keeps the match itself, even when the match is on another line. c/ deletes the same text and puts you in Insert mode. When the end is a character on the same line, dt is shorter, and a WORD or two goes with d2W.
Example
From Remove in “Remove this; keep the note”, d/keep then Enter leaves “keep the note”. c/keep stops at the same place and lets you type new text.
Use Start over to try again.
Guides on this topic
Exercise 1 of 4
0keys
par 6Shorten the note: remove which you can read at any time on the help page, .