Skip to content

Instantly share code, notes, and snippets.

@JGAntunes
JGAntunes / vim-cheat-sheet.md
Last active October 22, 2021 11:36 — forked from FabioAntunes/vim-cheat-sheet.md
Vim cheat sheet

Find (and replace)

  • /[pattern] search forward for pattern
  • ?[pattern] search backward for pattern
  • n repeat search forward
  • N repeat search backward
  • * search for word currently under cursor
  • g* search for word partially under cursor
  • [I show lines with matching word under cursor
  • %s/background/&-color/g find and replace background with background-color. & inserts the matched pattern
  • %s/yolo/swag/gc find and replace yolo with swag and ask for confirmation. c asks for confirmation