this post was submitted on 03 Jul 2025
24 points (100.0% liked)
Programming
21456 readers
344 users here now
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 [email protected]
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
^(update: just added a new link)^
The way you describe and show it, is called foldmethod "marker". The advantage of markers are, that they are built into the file. The disadvantage is, its built into the file. I rather like having the source independent from folding markers. The good news is, you can change the foldingmethod in Neovim and ignore the marker comments and instead use your own method.
A simple one is just "manual", where you set what is foldable and not. There are some automatic ones, like based on indentation and such. I was never a folding guy anyway, so don't really know all the differences when to use and how they differ. Neovim has following foldmethod: manual, indent, expr, syntax, diff, marker. The "expr" method even allows you a custom code and logic.
It makes sense it's a Vim thing since it's used in kitty config. When I search for marker based folding as someone else said it's called above, almost everything I get is for Vim. It's always confused me why gui-based text editors seem to not have a lot of visually-based features like this compared to terminal-based editors. I guess it's harder to create a system for user customization in a GUI application.
At least Kate has some support. Now that I know what it's called I will look into what else is available there.