8 points

I don’t think folding code parts is a default feature that everyone needs. Vim has folding already and I never use it. To me it is kind of pointless. If the code is messy, then you probably should split it up into several files. There is also a better way to me, through listing jump points on the side (such as function definitions). But its good to have extensions to provide that functionality if you rely on.

The second option is clearly superior

No, the first option is clearly superior. I don’t like collapsed code, its hiding stuff and doesn’t help in anything to me. Its better to see the entire context. The same list of function definitions can be displayed in a more useful jump list on the side (in my opinion).

But maybe its a question of implementation. I would like to see advancements in this field, to see if it is more useful than the current features we have to fold methods and functions.

permalink
report
reply
2 points

I just found nvim-ufo - “The goal of nvim-ufo is to make Neovim’s fold look modern and keep high performance.

permalink
report
parent
reply
8 points
*

I read this and I kept thinking at first “There’s no way I haven’t seen this in IntelliJ bef…”… oh. Of course that’s the one positive example. 😅

Two thumbs up Jetbrains. And yeah, I think all IDEs for all languages should allow this as a modified view type. Maybe even bidirectional for special cases.

permalink
report
reply
7 points

Honestly I think function folders is the wrong solution here. I see two different modes of exploring the code here - a high level over view of what is available and a detailed look at the actual code. Code folding to switch between these two modes is not, I think, the best way to do this. Just the easiest thing to replicate in most editors.

A better solution would be a separate view for these - maybe a side bar or overlay that you can popup when you want to navigate the code.

Rust docs has this - a summary of the methods and other symbols on the side with full descriptions in the main view.

Helix has a nice symbol picker which with some tweaks could be a much nicer way to do this:

If it did not strip so much info from the symbols it would basically show the collapsed view along side the code with the ability to search and jump to the code you are interested in. I want to see more refinement on features like this and not just have code folding which I tend to find more annoying and limiting - having to constantly collapse and expand sections when what I really want is to jump around the code base.

permalink
report
reply
6 points

I’ll never get over how cool animated code folding looked when I first saw it. I love my terminal but man that’s sexy. Reminds me of some of the original demos of Dion. I feel there is definitely room to reinvent how we view and edit code.

permalink
report
reply
5 points

Betteridge’s law of headlines…

permalink
report
reply

Programming

!programming@programming.dev

Create post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Community stats

  • 3.1K

    Monthly active users

  • 892

    Posts

  • 7.7K

    Comments