Monday, June 20, 2011

Re: Exasperated with folding

On Jun 20, 8:55 am, Eric Weir <eew...@bellsouth.net> wrote:
> On Jun 19, 2011, at 10:41 PM, Vlad Irnov wrote:
>
> >>> 2) Copy the following code into it. WARNING: long lines may get split
> >>> during posting.
>
> >> With that in mind I'm uncertain whether the line below should wrap, i.e., whether the stuff in parens should be on a second line.
>
> >>> " this is one line
> >>> setl foldtext=getline(v:foldstart).'\ \ \ /'.v:foldlevel.'...'.
> >>> (v:foldend-v:foldstart)
>
> > Yes, it's one line. Please copy/paste my code from here to avoid any
> > confusions:
> >https://gist.github.com/1035030
>
> Thanks, Vlad. I've copied the script from the github. Folding is not working for me very well, not at all really. When I first tried it on the readme.markdown file I managed to get a partial fold on the first header, but not on any others. I get only "Fold could not be found errors." By "partial" I mean that only some of the lines subordinate to the header were included in the fold. Subsequently I have not been able to generate any folds in the file, not even the one on the first header with which I had success initially. Perhaps I do not understand expression based folding, and within that, markdown header based folding.

Execute the following command in a markdown file such as
README.markdown to see if everything was set up correctly
:set ft? fdm? fde?
The output should be
filetype=markdown
foldmethod=expr
foldexpr=Foldexpr_markdown(v:lnum)

What do you do to "generate" folds? With expression based folding you
don't generate folds. They are created automatically when you load
file or edit text. You can only close and open folds with commands
zM,zR,zc,zo and so on. You can also enable option 'foldcolumn'
:set foldcolumn=6
and then open/close folds by clicking +/- signs with the mouse.

Regards,
Vlad

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: