Most important navigation (besides hjkl)
b
(back a word),e
(end of word),ge
(back to end of word)- Jump to character in a line using
f
ort
(to go to the position one before the searched char) - Change text up to the searched char, e.g.
cf
and the char you are looking for. H
(high),M
(middle),L
(low) for cursor placementzz
to center cursor in middle of screen,zt
andzb
for top and bottomCtrl-e
andCtrl-y
to scroll up and down, keeping the cursor at its positionCtrl-o
to jump back to the previous (older) location,Ctrl-i
for opposite direction
Jumps
- ctrl+o
- ctrl+i to go forward (once you've gone backward, of course)
Splits etc
- Jump beween split screens
Ctrl-W Ctrl-W
- Rotate splits
Ctrl-W r
Comment code block (source https://stackoverflow.com/a/1676690/356463)
- Ctrl-V (visual block mode)
- Select
- Press
#
- Esc and wait some 100ms
Uncomment
- Ctrl-V
- Select
- Press
x
Useful links https://vim.fandom.com/wiki/Moving_around