Underutilized (by me) (n)vim bindings / commands:

doing non-insert things while remaining in insert mode:

  • Ctrl-[: leave insert mode, same as Esc (and often easier to reach)
  • Ctrl-o: one normal command, then back to insert.
  • Ctrl-w: delete previous word.
  • Ctrl-u: delete back to start of line.
  • Ctrl-h: backspace, often easier than reaching for Backspace.
  • Ctrl-t: increase indent
  • Ctrl-d: decrease indent
  • Ctrl-r 0: insert last yanked text
  • S-Right/S-Left: move right/left one word (could go in section below but I generally

horizontal motions

  • gm: jump to middle of screen
  • gM: jump to middle of current line's text
    • 25gM: jump to the 25% mark of current line's text
  • ; and ,: repeat the last f/F/t/T search, forward or backward respectively
    • and for treesitter, these are conveniently bound to jump to repeat the last treesitter motion

misc normal mode

  • R: replace multiple characters (typing on top of while replacing extant text)
  • H/M/L: move cursor to top, middle, or bottom of window
  • U: undo any changes in the current line
  • z<CR> or zt: redraw, current line at top of window
  • z. or zz: redraw, current line at center of window
  • z- or zb: redraw, current line at bottom of window
  • Ctrl-Y and Ctrl-E are handy, moving the view up/down a line without moving the cursor.
    • And strange but cool... in insert mode they copy the character from the above/below line. Great for csv style editing.
  • ci for change inner (ca for change around)...
    • ci" to change content inside a pair of quotation marks
      • and the same for any pair ci( or ci) to change content inside parens (and likewise for any other pair
    • caw changes a word
    • cas change a sentence
    • cap change a paragraph
  • q: command history window
  • q/ search history window (and q? for backward-search history) -number G moves to that line number (I've always used :number<Enter>)

some direct quotes from the manual on reading and writing files (and system commands)

To save part of the file, type v{normal} motion :w FILENAME{vim}. **

To retrieve the contents of a file, type :r FILENAME{vim}.

NOTE: You can also read the output of an external command. For example, :r !ls{vim} reads the output of the ls command and puts it below the cursor.