Skip to content

Instantly share code, notes, and snippets.

@motiko
Forked from lestoni/gist:8c74da455cce3d36eb68
Last active October 10, 2018 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motiko/9753b205e6f0704e5d2af9a91a2951be to your computer and use it in GitHub Desktop.
Save motiko/9753b205e6f0704e5d2af9a91a2951be to your computer and use it in GitHub Desktop.
vim folding cheatsheet

via (https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun)

  • za toggle a fold at the cursor (zo/zc)
  • zA toggle all folds at the cursor (zO/zC)
  • zm increases the foldlevel by one.
  • zM closes all open folds.
  • zr decreases the foldlevel by one.
  • zR decreases the foldlevel to zero -- all folds will be open.
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment