I have a file with foldmethod=indent
. I have the folds automatically open when I enter them, and close when I leave them. When I sit in Normal mode on the bottom line of a fold and press o
, the fold closes and I can't see what is in it.
I want Vim to understand that when I'm in a fold and type a command that leaves the fold but enters Insert mode, I want that fold to stay open.
:set foldclose=all
, correct? I don't think there's a setting that will prevent the fold from closing while you append a new line witho
at the end of a fold when that setting is enabled though...:set foldclose=all
. How about usingautocmd InsertEnter ...
? That's what I tried before, although I am not good enough at Vimscript to make it work.