Automatic folding with the vimtex plugin are unbearably slow.
Is there anything I can do to speed this up? I tried installing the fastfold plugin but that did nothing I could notice.
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
First: Did you bother to read the vimtex documentation, i.e.
:h vimtex-folding? The docs clearly point out that the
fold-expr method of folding is slow, and so therefore provides an option
g:vimtex_fold_manual which if enabled (set to nonzero value) will set
foldmethod=manual, and instead will remap
zX to recalculate the folds when necessary (typically not very often).
The fastfold plugin is a very good alternative, as it will automatically ensure that the foldmethod is set to manual. This will also work for other file types, and the plugin provides a set of possibilities for when the folds should be refreshed.
Disclaimer: I am the developer of vimtex.