Skip to content
dmonllao edited this page Feb 19, 2013 · 1 revision

List of all useful shortcuts for Vim beginner

Mode

  • insert mode: i
  • move mode: esc
  • visual mode: v

Oops

  • undo: u
  • redo: Control-r

Switch file

  • Open file: e: filepath
  • next file: :bn
  • previous file: :bp
  • list of opened files: :ls
  • go to an opened file: X Control-^ X being number of buffer. Control-^ being Control-6 on my keyboard.

Search

  • Search for function declaration in all projects:
  • Search for string in all projects:
  • Search for string in file: /xxxx
  • Search for next string in file: n
  • Next occurence of a word: *
  • Previous occurence of a word: #

Moving

  • Page down: Control-f
  • Page Up: Control-b
  • Bottom of the file: G
  • Top of the file: gg
  • Go to the matching bracket: %
  • Beginning of the line: 0
  • Move around: Shift-arrows
  • line number: :XXX
  • next function: ]]
  • previous function: [[
  • next paragraph: }
  • previous paragraph: {

Windows

  • retract left window: F7
  • retract right window: F8
  • Right window: Control-w right_arrow
  • Left window: Control-w left_arrow
  • close current window: :clo
  • From navigator open in new windows: s

Git

  • diff:
Clone this wiki locally