Skip to content

Instantly share code, notes, and snippets.

@euclio
Last active October 8, 2015 15:14
Show Gist options
  • Save euclio/3bacec5183e619433ce6 to your computer and use it in GitHub Desktop.
Save euclio/3bacec5183e619433ce6 to your computer and use it in GitHub Desktop.
Vim tricks that I either commonly forget or want to remember.
  • "# - Alternate file register. Use with :sp#, :e# etc. to reopen an accidentally closed buffer.
  • * - Search with the current word under the word.
  • resize - Resizes the current split. Can be used with (+|-) size to add or remove rows. Use vertical resize to widen a split.
  • :cq - Quit vim with an error code
  • / may be used as a motion!
  • Repeat last colon command: @: (NOT :@). Further repetitions may be done with @@.
  • :echo @% - Echo the name of the current file. Also, Ctrl+G.
  • q: - Command history, q/ - Search history
  • :enew - Edit a new, unnamed file
  • :sb n - Open buffer n in a split. Use with :vert to do a vertical split.
  • Jump to previous location: Ctrl+O, jump to next location: Ctrl+I (Tab)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment