Skip to content

Instantly share code, notes, and snippets.

@cdosborn
Last active August 29, 2015 14:21
Show Gist options
  • Save cdosborn/3e9ead94d5ae1fbf69c6 to your computer and use it in GitHub Desktop.
Save cdosborn/3e9ead94d5ae1fbf69c6 to your computer and use it in GitHub Desktop.
vim-tips

vim-tips

Whenever something feels tedious in vim, it's generally a sign of not full grokking vim. There's a better way.

Help

:help
:help {topic}
:help buff<TAB> 

navigate help docs

  • C-{ jump to the underlined link in the vim docs

Multi-file

vim -p *.c # open multiple files each in a tab (pages in vim)
vim *.c    # open multiple files in vim

tabs (pages)

  • gt g o to next t ab
  • gT go back a tab (shift is a common way to do a binding backwards when that makes sense)
  • {N}gt go to Nth tab

buffers (vim's idea of a file)

  • :buffers list all the buffers vim has open
  • :bn b uffer n ext
  • :bp b uffer p revious
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment