For some Markdown documents, I like them to open with some sections initially folded (I use the plugin vim-markdown-folding). I've tried setting a modeline that looks like this:
<!-- vi: set foldmethod=indent foldlevel=1: -->
This works, but unfortunately, every time I save the buffer, even with it still open, the folding is reset back to foldlevel
1. I'd really like it if the modeline only took effect when the file is first opened.
Is this possible?
vim --clean
? I wonder if there is some autocommand or something triggering this; nothing in the modeline help indicates this is default behavior – D. Ben Knoble♦ May 21 '20 at 21:35:noautocmd w
to save? – filbranden♦ May 22 '20 at 1:55:au BufWrite
to see if it's set up by some plugin or such. – Matt May 22 '20 at 8:44