Open NathBabs opened 1 year ago
This seems like an interesting feature - I've never used this in other editors. Thanks for the feedback @NathBabs.
Ran into how cool this was just now when playing with Pulsar to build an Atom keymap for Zed. Being able to select the level of indentation is super nice.
Atom had this folding feature not sure why it's missing as a basic feature in Zed. Can we get a fold option as part of the line number sidebar?
This is a very handy feature for when dealing with indented code to be able to focus on things within a certain indentation level.
Also, for simplicity sake, can we bring zed-industries/zed#5787 and zed-industries/zed#5556 into this discussion and close those issues out? It's very confusing to have to navigate three issues for the same topic and devs end up with more menial work having to follow the discussion in multiple places.
Just a note... what I just found useful... CMD+SHIFT+O
shows full outline of all the functions. Super easy to navigate.
Atom had this folding feature not sure why it's missing as a basic feature in Zed. Can we get a fold option as part of the line number sidebar?
This is a very handy feature for when dealing with indented code to be able to focus on things within a certain indentation level.
What is the name of these vertical lines? It's really helpful to work with python code or yaml in VSCode with these lines, but Zed doesn't have.
There's an issue for those to be added in Zed, and there they are called "indent guides":
Sorry @vuon9 .. Those lines are part of Pulsar (formerly Atom), they are called Indent Guides and is a built in feature of the editor.
I stopped using Zed and just moved to Pulsar.
I'd also like to chime in and state interest for Fold-All.
This is a feature Sublime Text had as well, and something I really miss in Zed.
For reference, here are the VSCode keyboard shortcuts for folds (source):
- [x] Fold (⌥⌘[) folds the innermost uncollapsed region at the cursor.
- [x] Unfold (⌥⌘]) unfolds the collapsed region at the cursor.
- [ ] Toggle Fold (⌘K ⌘L) folds or unfolds the region at the cursor.
- [ ] Fold Recursively (⌘K ⌘[) folds the innermost uncollapsed region at the cursor and all regions inside that region.
- [ ] Unfold Recursively (⌘K ⌘]) unfolds the region at the cursor and all regions inside that region.
- [ ] Fold All (⌘K ⌘0) folds all regions in the editor.
- [ ] Unfold All (⌘K ⌘J) unfolds all regions in the editor.
- [ ] Fold Level X (⌘K ⌘2 for level 2) folds all regions of level X, except the region at the current cursor position.
- [ ] Fold All Block Comments (⌘K ⌘/) folds all regions that start with a block comment token.
Alongside with level-folding, a current-cursor-level folding will be super-handy
This issue began to be discussed in 2022, and it is surprising that it has not yet entered the development plan.
Using the 'Cmd+Shift+o' component key alleviates the problem, but it's still intolerable to the habit.
Just arrived from linux, and yup can't stay if folding is not a "zed" thing.
This would also help to enable the zM
(close all folds) in Vim.
Oh no, I also just realized this feature is missing in Zed. It’s very handy in JS to fold all cases of a switch statement, since these don’t show up in the outline for example
Any predictions on when this feature will be released?
Not sure if this is the best place to share, but for zM and zR, the following workaround works okay for me:
{
"context": "vim_mode == normal",
"bindings": {
"z M": ["workspace::SendKeystrokes", "cmd-a z c escape g g"] // fold all
}
},
{
"context": "vim_mode == normal",
"bindings": {
"z R": ["workspace::SendKeystrokes", "cmd-a z o escape g g"] // unfold all
}
}
Check for existing issues
Is your feature request related to a problem?
Going through large files is really difficult.
Describe the solution you'd like
When I open a large file in VS Code, i can immediately fold all the code at a particular nesting level(Cmd + k + 4 (or a number) to be able to go through the code. It is very helpful to me in my DX. And also folding in the UI by the line numbers should be possible. The current folding capability in Zed is too basic to be useful for me
If applicable, add mockups / screenshots to help present your vision of the feature
No response