zed
zed copied to clipboard
Vim Mode - Fold/Unfold using `za`
Check for existing issues
- [X] Completed
Describe the feature
VSCode has a nice Vim command za
to fold / unfold code under cursor.
(This is not a native Vim behavior - Vim is natively more restrictive as you must have an existing fold for this to work.)
https://github.com/zed-industries/zed/assets/5413308/ed95f73c-7f77-4589-a79d-56bab93e716d
This works for all languages, as in markdown:
https://github.com/zed-industries/zed/assets/5413308/1e56ab80-f43b-4703-9e8d-3cf0a59170cc
If applicable, add mockups / screenshots to help present your vision of the feature
No response
you can do it with keymaps:
{
"context": "Editor && VimControl && !VimWaiting && !menu",
"bindings": {
// put key-bindings here if you want them to work in normal & visual mode
"g f": "editor::Fold",
"g u": "editor::UnfoldLines"
}
},
@rauann I might be wrong, but it seems to me that this solution has 2 problems:
-
gu
andgf
are already existing vim command - You have 2 different commands for fold/unfold, instead of only one that acts as a toggle
Bump! Would love this feature.
Also bump - Feels quite strange not being able to easily fold and unfold things. Are we able to hook the editor's folding controls (To enable the LSP to do a majority of the lifting work and defer to the indenting set there?)
Yes we absolutely need editor::ToggleFold
!