Closed anuvyklack closed 2 years ago
Thanks a lot, the perf is better than previous one!
I have found even better solution: silent! %foldclose!
and silent! %foldopen!
So you can, for example, in setup function set:
vim.keymap.set({'n','v'}, 'zR', '<Cmd>silent! %foldopen!<CR>', { desc = 'Ufo: open all folds' })
vim.keymap.set({'n','v'}, 'zM', '<Cmd>silent! %foldclose!<CR>', { desc = 'Ufo: close all folds' })
And not bother user with it.
Or set
vim.keymap.set({'n','v'}, '<Plug>(UfoOpenAllFolds)', '<Cmd>silent! %foldopen!<CR>, { desc = 'Ufo: open all folds' })
and allow user to do in his config
vim.keymap.set('n', 'zR', '<Plug>(UfoOpenAllFolds)')
like a charm, but I want to test them for a day.
Thanks!
By default, in Vim
zM
close not only top level folds, but all folds recursively. This pull request makecloseAllFolds
behaves the same way.