Wiki

by yszheda

View project onGitHub

Tip 5: Find and Replace by Hand

Return to the top: <<Practical Vim>>

  • *: executes a search for the word under the cursor at the moment.
  • cw: deletes to the end of the word and then drops into Insert mode.

Example: assume that we want to replace "content" in the first and third line with "copy" and watch each step.

References:

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