On Wednesday, January 9, 2013 4:20:44 PM UTC-6, Boris Danilov wrote:
>
> Okay, it's been a while until I felt I could formulate my question
> better. I want to open all folds that doesn't contain other folds
> inside of them (or in more complex scenario to open folds that contain
> at most N folds inside). I want other folds state keep unchanged.
>
> Then, why do I need it? I want the last (in this meaning that the fold
> is *last* when it doesn't contain other forlds) fold level always be
> open no matter what, so that when I finally get to it I don't need to
> open that. Actually I want to control it this way: open the *last*
> level or close the *last* level.
>
Ok, so if I understand correctly, with foldmethod=marker and the default fold
markers, and this example text:
folded text {{{1
is great {{{2 {{{3
for showing only parts }}}3
of a file }}}2
or maybe an outline }}}1
With all folds closed, this turns into:
folded text
After pressing zo:
folded text {{{1
is great
or maybe an outline }}}1
Now press zo on the "is great" line:
folded text {{{1
is great
of a file }}}2
or maybe an outline }}}1
But instead you want all folds open.
This cannot be accomplished with a simple option setting. However, if you press
zO or zA instead of zo or za, then any folds under the cursor will be opened
automatically to any level. Maybe this gets you where you want?
The other possibility I can think of, is to start with all folds open, then use
a :g or :folddoopen command combined with foldlevel() to close folds selectively
using the :foldclose command. This could be done in a BufWinEnter autocmd, for
example.
--
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
Thursday, January 10, 2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment