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

foldlevel-like functionality #226

Closed
Axlefublr opened this issue Jun 14, 2024 · 1 comment
Closed

foldlevel-like functionality #226

Axlefublr opened this issue Jun 14, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@Axlefublr
Copy link

I really like the default vim's zr and zm mappings, that have the semantic of "fold less" and "fold more".

This is useful if say, I have foldlevel set to 2, and then want to expand a bunch of the folds, instead of doing :se foldlevel=3 (which makes me have to remember the foldlevel that I have set currently), I can just do zr and express my intent more directly.

As far as I know, ufo doesn't have this kind of functionality. And because it's advised to keep foldlevel at a high value, I can't use the default zr & zm mappings.

It would be convenient to keep track of ufo's "foldlevel", whenever functions like closeFoldsWith() / openFoldsExceptKinds() are used, so that ufo's own zr & zm-like functionality can be implemented.

The idea for the implementation of that that I have, is to just have a map-like table that stores the buffer numbers as keys, and the current "foldlevel" as values. Then, when the closeFoldsWith() / openFoldsExceptKinds() functions are used, they would update that foldlevel value in the buffer.

Is this kind of functionality in-scope for the project? I would love to have it :)

@kevinhwang91
Copy link
Owner

#150

@kevinhwang91 kevinhwang91 added the duplicate This issue or pull request already exists label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants