Monday, June 20, 2011

Re: Exasperated with folding

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.

I have two-fold related commands in my .vimrc that it occurred to me might be interfering with the operation of your script. I commented them out, but I'm still not able to get folds. I've copied the commented out commands below.

"Defines text displayed for a fold. In this case, first screen line of text w/o dashes.
"set foldtext=v:folddashes.substitute(getline(v:foldstart),'/\\*\\\|\\*/\\\|{{{\\d\\=','','g')

"recall cursor location to last place of edit and remember the fold state
"set viewoptions+=cursor,folds

Thanks again,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA USA
eeweir@bellsouth.net


--
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: