What is the key binding for folding and expanding code blocks in ideavim plugin ?
(za works in vrapper for eclipse , but not in ideavim )
To fold or unfold a code fragment, press Ctrl+NumPad - / Ctrl+NumPad + . PyCharm folds or unfolds the current code fragment, for example, a single method. To collapse or expand all code fragments, press Ctrl+Shift+NumPad - / Ctrl+Shift+NumPad + .
endregion comments depending on the style you need, and name the created custom region. Now, when you select the Custom folding regions option, IntelliJ IDEA will fold such regions when you open your file in the editor. Before. After. Android - language-specific code fragments in Android.
source : ideavim help: fold
zo Open one fold under the cursor. When a count is given, that many folds deep will be opened. In Visual mode one level of folds is opened for all lines in the selected area.
zc Close one fold under the cursor. When a count is given, that many folds deep are closed. In Visual mode one level of folds is closed for all lines in the selected area. 'foldenable' will be set.
zM Close all folds: set 'foldlevel' to 0. 'foldenable' will be set.
zR Open all folds. This sets 'foldlevel' to highest fold level.
Adding these lines to your ~/.ideavimrc allows the zO and zC commands, which recursively open and close the folds under the cursor:
nnoremap zC :action CollapseRegionRecursively<CR>
nnoremap zO :action ExpandRegionRecursively<CR>
I find these to be super-helpful in vim, and was missing them when using PyCharm with IdeaVim. (HT: https://github.com/JetBrains/ideavim/pull/97 )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With