← All writing

Linux

Top 20 Essential Vim commands

A quick reference to Vim commands for editing, navigation, saving, and quitting.

0 views Copy this article’s link to your clipboard.
  1. :w - Save the current file.
  2. :q - Quit Vim.
  3. :wq - Save and quit.
  4. :q! - Quit without saving.
  5. i - Enter insert mode before the cursor.
  6. a - Enter insert mode after the cursor.
  7. o - Open a new line below and enter insert mode.
  8. O - Open a new line above and enter insert mode.
  9. dd - Delete the current line.
  10. yy - Yank (copy) the current line.
  11. p - Paste after the cursor.
  12. P - Paste before the cursor.
  13. u - Undo the last change.
  14. Ctrl+r - Redo the last undone change.
  15. / - Search forward for a pattern.
  16. ? - Search backward for a pattern.
  17. n - Repeat the last search in the same direction.
  18. N - Repeat the last search in the opposite direction.
  19. :s - Substitute text in the current line.
  20. gg - Go to the first line of the file.
More articles →