On Dec 6, 5:55 pm, Chris Jones <[email protected]> wrote:
> I was wondering if anyone had implemented a barebones form of syntax
> folding in Vim. By ‘barebones’, I mean something that automatically
> creates folds for sections & subsections and possibly lists & blocks.
>
Here is a method that is not automatical, but the effort is trivial.
I use marker fold method to fold asciidoc.Firstly put following line
to
~/.vim/ftplugin/asciidoc.vim, this set vim to show content of line
below
marker when something is folded.
setl foldtext=getline(v:foldstart+1)
Then in asciidoc text, put a comment line to set foldmethod, like
this:
// vim: fdm=marker
And when you want to fold some section, just put `// {{{1` `//
{{{2` ...
above title line.
> I was half-expecting to find some unofficial asciidoc.vim file floating
> around the web but came back empty handed¹.
>
> I was thinking that this would come in handy especially when editing
> larger documents.
>
> cj
>
> ¹Not quite actually, I found a python.vim file that does that for python
> code. Totally unrelated but turns out to be rather useful.
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.