Skip to content

Instantly share code, notes, and snippets.

@vegarsti
Last active December 6, 2016 13:52
Show Gist options
  • Save vegarsti/3bf49297be1b6e5f12691dd5471faf3a to your computer and use it in GitHub Desktop.
Save vegarsti/3bf49297be1b6e5f12691dd5471faf3a to your computer and use it in GitHub Desktop.

vim cheatsheet

  • C-w C-w [file]   split horizontally; open [file]
  • C-z: put Vim in the background
  • fg: put in foreground again
  • [n]dd: delete [n] lines (n defaults to 1) (and store in clipboard)
  • O: insert line before current line and enter insert mode
  • o: Same, but after current
  • :w save
  • %s/old/new/g: replace all occurrences of old with new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment