Closed mellery451 closed 10 years ago
From the Vim documentation (also available online):
*zf* *E350*
zf{motion} or
{Visual}zf Operator to create a fold.
This only works when 'foldmethod' is "manual" or "marker".
The new fold will be closed for the "manual" method.
'foldenable' will be set.
Also see |fold-create-marker|.
So it looks like zf
only works if foldmethod is set to "manual", while the vim-notes plug-in defines a custom fold method expression (driven by Vim script). I guess you have two choices:
Does this answer your question?
ok - so perhaps I don't know understand how to use the automatic fold support. I see that a header section will automatically expand when I enter it (move right). How do I get it to collapse?
That depends a lot on how you like to use Vim and its text folding feature (it's quite flexible and configurable) ... :-)
Below is what works for me, you may or may not like it but either way it should point you in the right direction:
" Make Vim open and close folded text as needed because I can't be bothered to
" do so myself and wouldn't use text folding at all if it wasn't automatic.
set foldmethod=marker foldopen=all,insert foldclose=all
I just realized, maybe all you're looking for is the zc mapping instead of zf
?
zc
works! .. I guess that's what I needed, but I will also take a look at your automatic fold settings. Thanks again.
I apologize in advance - this might just be user error.
Once I have a header section, I would like to selectively fold it (collapse). I tried zf in normal mode, but I get the error:
E350: Cannot create fold with current 'foldmethod'
Is there some other method for folding header sections? Or perhaps some other plugin is causing me problems...
Thanks for this plugin!