jsborjesson Yet another dev blog

Vim folding for dummies

Vim has a really powerful mechanism for folding, it has lots of different commands and settings you can tweak to make it behave just the way you want it - but sometimes you just want something out of your way.

  • zf - folds the region selected by a motion or from visual mode (to fold a paragraph for example do zfip or vipzf)
  • zo - opens the fold under the cursor
  • zR - opens every fold

For light, occasional use of folds, this is all you need. No settings required.