- Published on
zM zR in Neovim
In Vim (and Neovim), zM and zR are folding commands:
zM→ Close all folds (maximum fold level)zR→ Open all folds (reduce fold level to zero)
These commands are useful when dealing with large files where sections are folded for better readability. If you use folding based on syntax, indent, or manual marks, zM can collapse everything to give a high-level view, and zR can expand everything to show the full content.