My current vim configuration is set to auto close folds once the cursor moves out from their area with:
set foldmethod=syntax
set foldclose=all
That works really well. Therefore, I often feel the need of focus on 2 different fold section at the same time (i.e: two if
statements in different positions).
Unfortunately, the above becomes impossible with foldclose
set to all
considering the fact that by moving the cursor out of the first if
clause it will make the previous to close immediately.
By any chance, is there any way to temporarily mark that fold so it won't be influenced by foldclose=all
while I check both clauses and one finished, I can simply remove that blocking flag so it will come back to normal?
I think that the
syntax
method is the one that serves me well since it is usually what I look for when working with language specific folding.
As far as I know, this is not possible.
However, you could cheat by splitting the window (
:split
). This allows the cursor to be in a different position in each window, so you can have a different fold open in each.