Show Menu

vim Cheat Sheet by

vim

Cursor Movements

h, j, k, l
left, up, down, right
Shift + Up/Down
page up/down
w / W
jump forwards to the start of a word
e / E
jump forwards to the end of a word
b / B
jump backwards to the start of a word
^/0 / $
jump to start/end of line
gg / G
go to first/last line of the file
6G
go to line 6
Ctrl + b/f
page up/down
Ctrl + u/p
half page up/down

File Explorer

:vs file
vertical split with file/d­ire­ctory
:Vex
vertical split at current file
%
create a new file
R
rename file under cursor
D
delete file under cursor
t
open file under cursor in a new tab
 

Edit Mode

i / a
insert before­/after cursor
I / A
insert at the beginn­ing/end of line
o / O
insert after/­before current line
s
delete character
cw
delete until end of word
c$
delete until end of line
cc / S
delete current line

Misc

gf
open file under cursor
Ctrl-w gf
open file under cursor in a tab
 

Cut and paste

yw
yank until end of word
y$
yank until end of line
y0
yank from beginning of line
yy
yank a line
p / P
paste after/­before cursor
x / X
cut curren­t/p­revious character
dw
cut until end of word
d$ / D
cut until end of line
d0
cut from beginning of line
dd
cut a line
"add
cut a line into register "­a"
"­"d
delete current selection

Selection

vi(
select text inside parentese
v2i(
select text inside 2nd level of parentese
va(
select text and parentese
vat
select text and tag (HTML)
ci{
cut text in brackets and edit

Search and replace

/pattern
search pattern
?pattern
search pattern backward
*
search current word
n / N
next/p­revious search
:%s/ol­d/new/g
replace
:%s/ol­d/n­ew/gc
replace with confir­mations

Download the vim Cheat Sheet

1 Page
//media.cheatography.com/storage/thumb/gilad_vim.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          VI Editor Cheat Sheet
          Vim NERDTree Cheat Sheet
          cVim Keyboard Shortcuts