I have a plain text file that uses
-- >8 -- as section separators, e.g.:
-- >8 -- first section some content more content -- >8 -- second section some content more content -- >8 --
In order to more easily navigate the file, I want to fold sections between markers. I was expecting that would be as easy as:
set foldmethod=marker set foldmarker=--\ >8\ --,--\ >8\ --
But it results in nested folds.
I have found that I can use a fold-expression to achieve this (see answer below), but it seems rather excessive. Is there a simpler way of doing this?