On 4/16/06, Steve Hall <[EMAIL PROTECTED]> wrote:
> I must be missing something, is there a command to put all buffers
> into their own tabs and at the same time remove them from the current
> window? (This is gVim 7.0d, using guitabline.)

I'm not quite sure what you're asking, because the terminology is a
bit off.  Remember that in Vim a 'window' is a view into a single
buffer -- you can never have more than one buffer in a single window. 
Regardless of what you mean, though, I think you'll find that one of
these does what you want:

    :tab all
    :tab ball

The first opens a tab for every argument in the argument list.  The
second opens one tab for every buffer in the buffer list.  This second
perhaps most adequately describes what it is that you want.

> Using :set sessionoptions+=buffers starts a session with multiple
> buffers in one window.

It can certainly start a session with one buffer loaded into one
window, and N hidden buffers, assuming you're loading from a
pre-existing session file.

> The best I can do is to hack a loop closing and
> then :tabedit each. But this has the horrid result of Vim having to
> save, close, and re-open each file--when all the user wanted to do is
> "menu" the existing buffers across the tab bar.

This is only true without 'hidden' set, but it is an less-than-perfect
solution.  I would hazard that ':tab ball' is what you're after here.

> All edits, save state, marks, etc. should be preserved.

You could use 'set hidden' to make that the case, or you can use the
commands I've suggested above.  I would recommend using 'hidden', as
well, since it is a very handy setting.

If you're working with session files you may wish to ensure that
'sessionoptions' includes 'tabpages' -- this will save any tabbed
layouts when you use :mks (and is the default).

Hope that helps,
Chris Allen

Reply via email to