Vim
Survival
h, j, k, l: move cursor
i: enter insert mode
ESC: leave mode
:wq: write and quit
:q! quit (force)
Moving cursor
# move cursor
h j k l
# move relative
8j
# will move 8 line down
# go to last line
G
# go to line 5
5G
Shortcuts Normal mode
x: delete character
ro: replace current letter by o
dd: delete and copy line
Files
# open/create file in new tab
:new filename.ext
# open/create file in new vertical split
:vert new filename.ext
# switch between splits
CTRL-w h
CTRL-w j
CTRL-w k
CTRL-w l
# copy full file
:%y+
# paste
# read and insert a file
:r file.txt
# launch shell commands
:!echo 1
# launch shell commands and capture output in the file
:r! echo 1
# will insert 1
# sort a file
1G!Gsort
Links