Vim Folding Cheatsheet Link to heading

  • za toggle one fold under cursor
  • zA toggle all fold under cursor recursively
  • zc close one fold under cursor
  • zC close all fold under cursor recursively
  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zo opens a fold at the cursor.
  • zo opens a fold at the cursor.
  • zO opens all folds at the cursor.
  • zM closes all open folds.
  • zd deletes the fold at the cursor.
  • zE deletes all folds.
  • [z move to start of open fold.
  • ]z move to end of open fold.