[VIM] Cheat sheet

VIM QUICK REFERENCE CARD

Basic movement
h l k j character left, right; line up, down
b w word/token left, right
ge e end of word/token left, right
{  } beginning of previous, next paragraph
( ) beginning of previous, next sentence
0 gm beginning, middle of line
^  $ first, last character of line
nngg line n, default the last, first
n% percentage n of the file (n must be provided)
n| column n of current line
% match of next brace, bracket, comment, #define
nnL line n from start, bottom of window
M middle line of window

Continue reading

vi/vim cheat sheet

Cursor movement

  • h – move left
  • j – move down
  • k – move up
  • l – move right
  • w – jump by start of words (punctuation considered words)
  • W – jump by words (spaces separate words)
  • e – jump to end of words (punctuation considered words)
  • E – jump to end of words (no punctuation)
  • b – jump backward by words (punctuation considered words)
  • B – jump backward by words (no punctuation)
  • 0 – (zero) start of line
  • ^ – first non-blank character of line
  • $ – end of line
  • G – Go To command (prefix with number – 5G goes to line 5)

Note: Prefix a cursor movement command with a number to repeat it. For example, 4j moves down 4 lines.

Continue reading