Wiki

by yszheda

View project onGitHub

Tip 89: Eyeball Each Substitution

Return to the top: <<Practical Vim>>

The c flag causes Vim to show us each match and ask "Replace with copy?"

Trigger Effect
y Substitute this match
n Skip this match
q Quit substituting
l "last"——Substitute this match, then quit
a "all"——Substitute this and any remaining matches
<C-e> Scroll the screen up
<C-y> Scroll the screen down

References:

# If you open the file in vim,
# then you can \"ayy@a the next line to execute the vim command: 
:h :s_c