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

Vim's built-in za shortcut makes anyfold_toggle_key redundant #3

Closed
sunaku opened this issue Oct 21, 2016 · 2 comments
Closed

Vim's built-in za shortcut makes anyfold_toggle_key redundant #3

sunaku opened this issue Oct 21, 2016 · 2 comments

Comments

@sunaku
Copy link

sunaku commented Oct 21, 2016

Hello,

I find the mandatory mapping of anyfold_toggle_key to be unnecessary and imposing because Vim already has a za shortcut that essentially does the same thing: the only difference between them is that anyfold_toggle_key honors the g:anyfold_auto_reload setting whereas Vim's za does not. 😞

If you could expose the ReloadFolds() function as a <Plug>(AnyFold-Reload-Folds) shortcut, then we could do away with the 🙀 mandatory anyfold_toggle_key and instead allow the user to decide 🖐️ if they really want to trigger ReloadFolds() through a mapping (which is also of their choice):

nmap za <Plug>(AnyFold-Reload-Folds):normal! za<CR>

Thanks for your consideration.

@pseewald
Copy link
Owner

Hi,

I mostly agree. I initially planned a more sophisticated method for one-key-toggling of folds, but this should be a separate plugin and not part of AnyFold.

So yes, anyfold_toggle_key will go away and AnyFold should work with Vim's default folding commands. Exposing ReloadFolds() is unfortunately still a hack... Optimally, the foldexpr used should take care of keeping folds updated, but performance greatly suffers if this is done since reloading folds is really slow 💤.

So for the future, I'll consider implementing a faster fold updating, then there is no need to expose ReloadFolds(). This will take some time, so as an immediate solution I'll implement your suggestion.

Thanks for the suggestion.

@pseewald
Copy link
Owner

Hi again,
I went for the full solution that removes the need to expose ReloadFolds(). So the good news is, anyfold_toggle_key and anyfold_auto_reload are both gone. Folds are always updated when text changes, so everything works out of the box with Vim's built-in folding commands.

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