Skip to content

Instantly share code, notes, and snippets.

@jimnanney
Created July 27, 2013 20:16
Show Gist options
  • Save jimnanney/6096147 to your computer and use it in GitHub Desktop.
Save jimnanney/6096147 to your computer and use it in GitHub Desktop.
The ABC's of Vim
The abc's of Vim
a - Append
Changes from normal mode to insert mode appending after the character under the cursor
This is a useful thing to have when you wish to add to a word.
b - beginning of word (motion)
Moves the cursor to the beginning of a word.
c - change
deletes and places into insert mode
requires a motion describing what to change. ce changes to end of word, cw changes up to next word, c$ changes to the end of line.
d - delete
deletes characters
requires a motion describing what to delete. de deletes to end of word. dw deletes up to next word, d$ deletes to end of line.
e - end of word (motion)
moves to end of word
f - find
Moves the character to the first occurrence of character after cursor position on the same line.
g - extra commands
gg - go to top of file
gf - open file described by text under cursor
h - character left (motion)
moves the cursor left.
i - Insert mode
changes from normal mode to insert mode
j - line down (motion)
moves the cursor downward
k - line up (motion)
moves the cursor upwards
l - character right (motion)
moves the cursor to the right
m - sets a mark
sets a mark for later navigation - requires a a-z character to name which mark to use.
n - next (motion)
repeats previous find
o - open
Changes from normal mode to insert mode with a new blank line below the current cursor position.
p - paste
paste copied text after the cursor position if register contains only character(s), after line in register is line(s)
q - record macro
begins recording of keystrokes to be played back
r - replace
replaces character at cursor with next character typed.
s - substitute
replaces character at cursor position and changes to insert mode
t - till
Moves the cursor to the position before the first occurrence of the character typed on the same line from the current cursor position.
u - undo
undo last command
v - visual mode
switches to visual mode - allows selection of text not easily described by motions
w - word (motion)
Moves the cursor to the start of the next word
x - delete character
Deletes the character under the cursor position.
y - yank
yanks text into a register.
z - special commands
zt scroll to top of screen. (cursor stays on same line, but moves up)
zb scroll cursor to bottom
zz scroll cursor to center
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment