Show Menu
Cheatography

Vim Cheat Sheet (DRAFT) by

This is a description

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Movement

h j k l
← ↓ ↑ →
H M L
[ First | mid | last ] line of the screen
J K
5 lines ↓ or ↑
b e w
To [ beggining | end | next ] word
B E W
To [ beggining | end | next ] Word
0 ^ $
To [ start | first char | end ] of current line
gg | 123G | G
Go to [ first line | line 123 | last line ]
Ctrl^(u or d)
Scroll [ up | down ] half screen
Ctrl^(f or b)
Scroll [ up | down ] one full screen
zz
Scroll to center the cursor on the screen
%
Move to matching '(', '[' or '{'
[ f | F ]x
Move to [ next | previous ] occurence or x in the current line
[ t | T ]x
Move until x in the current line [ forward | backward ]
[ ; | , ]
Repeat last f or t [ normal | backwards ]
{ or }
Jump to [ next | previous ] paragraph of function block
Ctrl^(e or y)
Move screen [ down | up ] one line without moving cursor
6[oper­ator]
Repeat [operator] 6 times

Editing

r or R
Replace [ one | multiple ] characters
g( ~ or u or U )<m­oti­on>
[ toggle | lower | upper ] case up to <mo­tio­n>
cc or C
Change [ entire line | until the end of line ]
xp
Transpose two letters
u or Ctrl^r
[ undo | redo ]
 

Insert mode

i or a
[ insert | append ]
I or A
Insert text at [ start | end ] of current line
o or O
Open a new line [ below | above ] current
<le­ade­r>(o or O)
Insert a line [ below | above ] current line, without editing it
Ctrl^w
Delete last word in insert mode
Ctrl^(t or d)
[ indent | de-indent ] current line in insert mode
Ctrl^rx
Insert the contents of register 'x'
Ctrl^ox
Tempor­arily enter normal mode to issue command 'x'
Esc or jk
Exit insert mode

Search and replace

/abc
Highlight 'abc' occure­nces, then use 'n' or 'N' to move to [ next | previous ] occurence
?abc
Same as above, but reversed
<le­ade­r><­lea­der­>/abc
Find 'abc' in easymotion mode
*
Find next occurence of current word, then use 'n' or 'N'
:%s/ol­d/new
Replace all 'old' with 'new' throughout file
viwgb
Enter visual mode, select inner word and go multiple cursor
Ctrl^v
Multi line edit
 

VS Code intera­ctions

Ctrl^b
Show/hide left panel
<le­ade­r>p
Show command palette
<le­ade­r>tt
Open new tab
<le­ade­r>to
Close all other tabs
<le­ade­r>t(n or p)
[ next | previous ] tab
<le­ade­r>w
Save current file
Ctrl^w + (s or v)
Split window [ horizo­ntally | vertically ]
Ctrl^(h j k l)
Move between windows
Ctrl^w + c
Close current window

Cut and paste

yy
Yank a line
y<m­oti­on>
Yank until <mo­tio­n>
p or P
Put [ after | before ] cursor
dd
Delete a line
d<m­oti­on>
Delete until <mo­tio­n>
"­xy<­mot­ion>
Yank in register 'x' until <mo­tio­n>
"­xd<­mot­ion>
Cut in register 'x' until <mo­tio­n>
"xp
Paste register 'x'
:reg
View content of registers
"+y or "+p
[ yank to | paste from ] system clipboard

Marks

mx
Set current position for mark 'x'
`x
Jump to mark x
:marks
List marks
y`x
Yank text to position of mark 'x'
:ju[mps]
List of jumps
Ctrl^(o or i)
Jump to [ previous | next ] position