How do I close one more level of folds without collapsing all folds at once?
zm
Instead of jumping between fully open (zR) and fully closed (zM), zm and zr let you step through fold levels one at a time.
14 results for "zM close all folds"
zm
Instead of jumping between fully open (zR) and fully closed (zM), zm and zr let you step through fold levels one at a time.
zr and zm
The zr and zm commands let you incrementally adjust the global fold depth across the entire buffer — one level at a time.
zR and zM
When working with a heavily folded file, manually opening or closing each fold is tedious.
zMzv
The zMzv sequence collapses every fold in the file and then re-opens only the one containing your cursor.
zO and zC
zO and zC are the recursive counterparts to zo and zc.
:set foldmethod=indent
Setting foldmethod=indent tells Vim to create folds based on the indentation level of each line.
:lua require('ufo').openAllFolds()
nvim-ufo is a Neovim plugin that replaces the built-in fold system with one powered by LSP (textDocument/foldingRange) or treesitter.
zA
The zA command toggles the fold under the cursor together with all nested sub-folds in one keystroke.
zf{motion}
Vim supports several fold methods, but manual folding with zf gives you precise control over exactly which lines to collapse.
zO
zO (uppercase O) opens the fold under the cursor and all folds nested inside it recursively.
zj and zk
How it works When working with folded code in Vim, you often want to skip from one fold to another without unfolding anything.
:mkview 2 and :loadview 2
Vim supports up to 9 numbered view slots per file.
buffers-windows #folding #buffers-windows #navigation #config
vim.treesitter.foldexpr()
Neovim's built-in Treesitter integration includes vim.
:windo / :bufdo / :tabdo {command}
Vim's do commands iterate over collections and execute a command in each context.
buffers-windows #buffers #windows #tabs #batch-editing #ex-commands