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[operator] |
Repeat [operator] 6 times |
Editing
r or R |
Replace [ one | multiple ] characters |
g( ~ or u or U )<motion> |
[ toggle | lower | upper ] case up to <motion> |
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 |
<leader>(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 |
Temporarily enter normal mode to issue command 'x' |
Esc or jk |
Exit insert mode |
Search and replace
/abc |
Highlight 'abc' occurences, then use 'n' or 'N' to move to [ next | previous ] occurence |
?abc |
Same as above, but reversed |
<leader><leader>/abc |
Find 'abc' in easymotion mode |
* |
Find next occurence of current word, then use 'n' or 'N' |
:%s/old/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 interactions
Ctrl^b |
Show/hide left panel |
<leader>p |
Show command palette |
<leader>tt |
Open new tab |
<leader>to |
Close all other tabs |
<leader>t(n or p) |
[ next | previous ] tab |
<leader>w |
Save current file |
Ctrl^w + (s or v) |
Split window [ horizontally | vertically ] |
Ctrl^(h j k l) |
Move between windows |
Ctrl^w + c |
Close current window |
Cut and paste
yy |
Yank a line |
y<motion> |
Yank until <motion> |
p or P |
Put [ after | before ] cursor |
dd |
Delete a line |
d<motion> |
Delete until <motion> |
"xy<motion> |
Yank in register 'x' until <motion> |
"xd<motion> |
Cut in register 'x' until <motion> |
"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 |
|