Replace and substitute are two additional actions.
r<character> will replace the character under cursor with the new character. It keeps you in Normal Mode.
R puts you in Replace Mode. In Replace Mode anything you type will overwrite what’s currently on the line.
You can hit
escape to exit replace mode.
s will delete the character under cursor then place you in insert mode so
you can continue typing.
S will delete the text on the current line and place you in insert mode at
the beginning of the line.
S whenver I need to change an entire line and I’m not at the
beginning of that line. The neat thing about
S is that it respects tab
alignment. It’s essentially
^c$ combined into one command.
Ex commands are commands you type after typing
:. If you hit
start typing you will see your text appear on the command line. You can hit
enter to execute a command or
escape to get out.
:%s/old/new/g will replace “old” with “new” everywhere in your current
g stands for global.
c to the end to be prompted before making each change. This is great
for search and replace where you need to check each match and choose
whether or not to make the replacement.