← All tips

Replace Mode

Vim has a mode for replacing text, aptly called replace mode.

Replace mode works like insert mode, but instead of adding new characters, it replaces existing characters under the cursor. Sometimes, this is a faster way to change some text — if the new text is the same length as the old text, you don’t have to delete it first!

To enter replace mode, press R in normal mode. Any characters you type will replace the characters underneath the cursor.

Give this a try in the editor. Try changing James to Peter using replace mode!