How do I toggle a fold and all its nested folds open or closed at once?
zA
The zA command toggles the fold under the cursor together with all nested sub-folds in one keystroke.
8 results for "za fold toggle"
zA
The zA command toggles the fold under the cursor together with all nested sub-folds in one keystroke.
zf / zo / zc / za
Vim's folding system lets you collapse blocks of code into a single line, hiding the details so you can focus on the structure.
editing #editing #folding #navigation #normal-mode #productivity
zR and zM
When working with a heavily folded file, manually opening or closing each fold is tedious.
zi
Pressing zi in normal mode toggles the foldenable option, which controls whether folds are active in the current window.
zO
zO (uppercase O) opens the fold under the cursor and all folds nested inside it recursively.
:set foldmethod=indent
Setting foldmethod=indent tells Vim to create folds based on the indentation level of each line.
vim.treesitter.foldexpr()
Neovim's built-in Treesitter integration includes vim.
zr
zr ("reduce" fold level) decrements the global foldlevel option by 1, opening the next layer of folds across the entire file.