zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.83k stars 3.15k forks source link

Quick Code Folding File Overview #14662

Open sebastiansandqvist opened 4 months ago

sebastiansandqvist commented 4 months ago

Check for existing issues

Describe the feature

An awesome feature in the makepad.dev editor is the ability to fold all but the two outermost blocks of code in a file (using the alt key), zooming the rest of the code out. I believe that since Zed has deep LSP integrations and runs its rendering through the GPU, it should be well suited to implement something like this.

https://github.com/user-attachments/assets/d7c0f34f-c6b6-43fb-8dbc-a4bfb4de494a

The first time I saw this feature I was amazed by how useful it is for getting a high level overview of a file at a glance and for quickly zooming around a file. The cmd-shift-O outline view in Zed is similar, but it's just out of the way enough that I don't find myself reaching for it nearly as often. I think this is one of those features that you have to play around with a bit to fully appreciate. I see it as a more ergonomic alternative to Zed's outline view. An interesting detail is that you can place the cursor anywhere within the zoomed out parts of the code and the editor still responds as though the code were unfolded.

Any interest in adding such a feature?

If applicable, add mockups / screenshots to help present your vision of the feature

No response

SomeoneToIgnore commented 4 months ago

Zed also has an outline panel now, so that might be some sort of alternative (and it's not a modal, so can be always opened on a side)

notpeter commented 4 months ago

Related: