Created: 2023-02-05 20:14

Horizontal

  • f / t move to a character on the current line (forward/backward respectively)
  • F / T move before a character on the current line (forward/backward respectively)
  • ; / , repeat the motion (forward/backward respectively)

Vertical

  • { / } => move one paragraph up/down
  • Ctrl + d / Ctrl + u jumps half a page up/down. This could be coupled with zz, which centers the view to always land in the middle of the screen
  • G / gg go to the bottom/top of the file.
nnoremap("<C-d>", "<C-d>zz")
nnoremap("<C-d>", "<C-d>zz")
  • / search forward
  • ? search backwards
  • n / N go to the next/prev result, which is inverted when searching backwards.
  • * searches the word under the cursor

Searching movement can be coupled with zz to center and zv to unfold.

nnoremap("n", "nzzzv")
nnoremap("N", "Nzzzv")