Thursday, June 2, 2011

Re: Folding

On Jun 1, 2011, at 10:53 AM, Ben Fritz wrote:

> On Jun 1, 8:37 am, Eric Weir <eew...@bellsouth.net> wrote:
>
>> I understand folds can be indented.
>
> How do you mean? You can fold based on existing indent, which will
> fold all lines having the same indent into a single displayed line,
> where "line" means a newline-terminated string.
>
> Or, if you have a fold, you can use the >> operator to increase the
> indent of everything inside the fold.

I meant both. I see that neither accomplishes what I wanted, i.e., for the folded indent to display as indented. As it is, it appears to me that the only way to know a fold is indented is to undent it.

But having tried that I see that that would not have accomplished what I wanted anyway, i.e., for all text with a certain range of a given line to "disappear under" that line. But I see that there is a way that can be done, by folding the other lines first, then folding on the first line and the lines that have already been folded.

I just wish I could get rid of the prefix that indicates how many lines there are in the fold. No doubt that is useful to some. To me it is clutter. It just gets in the way. The text of the top level line is sufficient to identify what's in the fold as far as I'm concerned.

>> Is it possible to get Vim to wrap words to the indent column?
>
> Again, what do you mean by wrapping? Usually this means you have a
> single long line which Vim displays on many lines by "wrapping" the
> text which goes past the edge of the window. This is accomplished by
> setting the 'wrap' option and probably 'linebreak' as well so that Vim
> only wraps at word boundaries.

I've done that. The options you suggest either don't do what I want, i.e., to display all and screen lines of an indented text, and only those lines as indented; or do things I don't want, e.g., insert hard returns into the text.

That said, I've come to the conclusion that I don't need to do what I wanted to do, that the method of "folding on folds" will accomplish most of what I wanted.

>> Is there a way I can get folds to persist across a save and reload?
>
> I understand the :mkview command will save manual folds, which
> the :loadview command will restore. There is probably a plugin to do
> this for you automatically.

Sounds like that would do the job. Especially if I could do it on a per file basis, i.e., without specifying filetypes to which it applies or having it apply globally.

I'll read up on the command, and will probably have more questions after that.

Thanks for the informative response to my noobie questions.

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

Post a Comment