mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-01-30 22:57:59 +00:00
1.5 KiB
1.5 KiB
Neovim folds
- it is a built-in feature in Neovim; enables you to quickly navigate a long document by hiding them and opening them when you want
-
some keybindings for managing folds
Keymap Description zf
Create a fold. zA
Toggle a fold recursively. zM
Close all folds. zR
Open all folds. zj
Move one fold down. zk
Move one fold up. - while in insert mode, there are no folds under your cursor so you can see what you type
-
while manually managing folds can be tedious, Neovim does have a way to automatically manage folds for you; this is dictated through the
foldmethod
variable; for more information for the following methods, seefold-${VALUE}
with the Neovim help system- with
manual
value, no additional actions are done - with
marker
value, a fold will be created ala-HTML markers - with
expr
value, a fold will be managed through its fold level evaluated fromfoldexpr
function; certain tools like nvim-treesitter takes advantage of this to arrange the code through its blocks, scope, etc.
- with