Cheatography
https://cheatography.com
file
:q |
quit |
:w |
write changes |
:q! |
quit without write changes |
:wq |
write changes and quit |
:w file |
write changes to new file |
:tabnew file |
open file in a new tab |
:split file |
open file in new horizontal split |
navigation
h|j|k|l |
left|down|up|right |
w|b |
start of next|previous word |
0|$ |
beginning|end of line |
gg|G |
first|last line of file |
:n |
go to line number n |
gt|gT |
go to next|previous tab |
ctrl+w w |
cycle through splits |
/pattern |
search for pattern |
n|N |
go to next|previous match |
edit
i |
insert |
x |
delete character under cursor |
daw |
delete word under cursor |
dd |
delete entire line |
d0|$|gg|G |
delete from cursor |
y |
copy character under cursor |
yaw |
copy word under cursor |
yy |
copy entire line |
y0|$|gg|G |
copy from cursor |
p |
paste after cursor |
~ |
toggle case of character under cursor |
:s/old/new/g |
replace all(g) occurrences of old with new on current line |
:%s/old/new/g |
replace all(g) occurrences of old with new in entire file |
:n,m<command> |
apply command between lines n,m |
u |
undo |
ctrl+r |
redo |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets