Friday, August 14, 2015

Re: Open folds to a certain level within a range of lines

ANDY KENNEDY <ANDY.KENNEDY <at> adtran.com> writes:
>> I actually use those two commands all the time. However, I may
>> have many dozens of nested folds in a particular range. I was
>> hoping that there was a command that can be applied over a range
>> that can open folds down to a depth of (say) 3. I was not able to
>> find such a command in the help.
>
> If you are only wanting to open a few folds (and only every once in
> a while), you could do something like:
>
> :range foldopen
>
> Then recall that command a few times. If your range is a selection,
> it seems to work too.
>
> Looks like it would be fairly easy to write a script to do this for
> you. You'd want to do something like
>
> :range foldopen
>
> in a loop.
>
> Vimscript is fairly easy to learn.

Actually, that works well! If I marked the range start & end using
mark 'a' and mark 'b':

'a,'b foldo

Then the normal command "q:" (without quotes) lets me cursor up one
line to repeat it. No scripting required.

Thank you!

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: