Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility of defining custom folds? #134

Open
ychnh opened this issue May 8, 2022 · 1 comment
Open

Possibility of defining custom folds? #134

ychnh opened this issue May 8, 2022 · 1 comment

Comments

@ychnh
Copy link

ychnh commented May 8, 2022

I would like to modify the plugin to allow custom folding based on markers.
(I have some groups of functions that I would like to hide all together. I want to put a markers between these functions and have SimpylFold automatically fold them as a group. These functions are part of a class and I would like to keep them within the class without using inheritance. )
How difficult would this be?

PS: Thank you for the great tool. It is very useful.

@tmhedberg
Copy link
Owner

Vim has built-in marker-based folding (:set foldmethod=marker), but I'm assuming you know about that and want to combine marker folds with SimpylFold's syntax-based folds.

Unfortunately, there's no simple way to do this natively—Vim only allows one foldmethod at a time. It would take an update to this plugin to look for markers in the buffer and add folds for them in addition to the existing folding heuristics. I don't think this would be too challenging to accomplish, but you would probably need to work on it yourself, as I don't really plan on adding more features on my own time. If you feel inclined to implement it, I'd consider merging it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants