- Leave without saving
:q!Press Esc first, so Vim is ready for a command.
- Save and leave
:wqPress Esc first, so Vim is ready for a command.
- Just save
:w - Start typing (insert mode)
iPress Esc when you're done typing.
- Undo, and redo
uRedo is Ctrl + r.
- Search for a word
/wordPress n for the next match, N for the previous one.
- Delete the current line
dd - Copy the current line and paste it below
yyp - Jump to the start or end of the file
ggG (capital) goes to the end.
- Find and replace everywhere
:%s/old/new/g
- Leave without saving
:q!Press Esc first, so Vim is ready for a command.
- Save and leave
:wqPress Esc first, so Vim is ready for a command.
- Just save
:w - Start typing (insert mode)
iPress Esc when you're done typing.
- Undo, and redo
uRedo is Ctrl + r.
- Search for a word
/wordPress n for the next match, N for the previous one.
- Delete the current line
dd - Copy the current line and paste it below
yyp - Jump to the start or end of the file
ggG (capital) goes to the end.
- Find and replace everywhere
:%s/old/new/g
- Leave without saving
:q!Press Esc first, so Vim is ready for a command.
- Save and leave
:wqPress Esc first, so Vim is ready for a command.
- Just save
:w - Start typing (insert mode)
iPress Esc when you're done typing.
- Undo, and redo
uRedo is Ctrl + r.
- Search for a word
/wordPress n for the next match, N for the previous one.
- Delete the current line
dd - Copy the current line and paste it below
yyp - Jump to the start or end of the file
ggG (capital) goes to the end.
- Find and replace everywhere
:%s/old/new/g