golb

Vim

Survival

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

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
"P+
# 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