vim Folding Opening, Closing and Toggling Folds


Example

  • zo opens a fold underneath the cursor.
  • zO opens all folds underneath the cursor, recursively.
  • zc closes a fold underneath the cursor.
  • zC closes all folds underneath the cursor, recursively.
  • za toggles a fold under the cursor (a closed fold is opened, an opened fold is closed).
  • zM closes all folds in the buffer.
  • zR opens all folds in the buffer.
  • zm closes a level of fold in the buffer.
  • zr opens a level of fold in the buffer.