Different buffer list for different tabs?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Different buffer list for different tabs?

borasah


Hi,

What I would like to do is to work on different projects in the same Vim
program. As far as I know a tab page holds a group of windows, not a buffer
list but I am wondering if I can use one tab for one project and the other
tab for the other project so each project has different buffer lists. Maybe a
tab isnt the right way but is there a way to achieve this or is it completely
against the Vim philosophy?

Thanks...

--
Bora Sahin

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Different buffer list for different tabs?

Raúl Núñez de Arenas Coronado-2

Saluton :)

<[hidden email]> skribis:
> What I would like to do is to work on different projects in the same
> Vim program. As far as I know a tab page holds a group of windows, not
> a buffer list but I am wondering if I can use one tab for one project
> and the other tab for the other project so each project has different
> buffer lists. Maybe a tab isnt the right way but is there a way to
> achieve this or is it completely against the Vim philosophy?

I don't know if this is against Vim philosophy (or policy, or just
"unvimmie") but I think it would be useful.

I see problems, though, like ":bufdo" on such a tab.

Anyway, why do you need separated buffer lists?

--
Raúl "DervishD" Núñez de Arenas Coronado
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Different buffer list for different tabs?

Tim Chase
In reply to this post by borasah

> What I would like to do is to work on different projects in
> the same Vim program. As far as I know a tab page holds a
> group of windows, not a buffer list but I am wondering if I
> can use one tab for one project and the other tab for the
> other project so each project has different buffer lists.
> Maybe a tab isnt the right way but is there a way to achieve
> this or is it completely against the Vim philosophy?

I'm not sure it's so much philosophy, but how the hierarchy is
defined.  Vim has a hierarchy of

  Vim instances ->
    Buffers ->
      Tabs ->
        Windows

and as Raul notes, inverting that hierarchy (or a piece thereof)
causes weird behaviors such as the treatment of "bufdo" when
you're on a tab.

A readily accessible solution is to use multiple vim instances to
solve the problem.  On the console, this can be done with GNU
"screen".  In X, my window manager (fluxbox) can group windows
together in tabbed groups so I can have multiple gvim windows (or
consoles with [non-g]vim, or any mix thereof) and then use my
window-manager's tab-management for such purposes.  Since it's at
the WM level, I can even mix in a console tab for compiling, a
browser tab such as Dillo for reading online help, etc.  They all
move/resize/minimize as one window, but I can click between the
tabs (or use key-chords defined in my ~/.fluxbox/keys).  With
other WMs, YMMV.

Hope this gives you some ideas,

-tim





--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Different buffer list for different tabs?

borasah
In reply to this post by Raúl Núñez de Arenas Coronado-2


> Saluton :)

Salute :)

> <[hidden email]> skribis:
> > What I would like to do is to work on different projects in the same
> > Vim program. As far as I know a tab page holds a group of windows, not
> > a buffer list but I am wondering if I can use one tab for one project
> > and the other tab for the other project so each project has different
> > buffer lists. Maybe a tab isnt the right way but is there a way to
> > achieve this or is it completely against the Vim philosophy?
>
> I don't know if this is against Vim philosophy (or policy, or just
> "unvimmie") but I think it would be useful.
>
> Anyway, why do you need separated buffer lists?

Think a scenario like that: a main project consisting of smaller relatively
independent projects. Their size differences might not be so huge but
logically they are different so they can be treated separately.

Sometimes I would like to look things up in the main project using cscope or
another way but I dont want them to be seen in the buffer list. Actually from
time to time or maybe mostly in nowadays I have more than 20 buffers open. It
is not so quick to switch between them. So if you can keep them separately in
one vim instance, buffer lists will be specific to each of them. Then you can
use tab commands or whatever it is to switch between different projects and
you have clean buffer lists and hopefully smaller. Although I heard
BufExplorer, I havent tried it yet. I am not sure if it can address the
problem I described.

> I see problems, though, like ":bufdo" on such a tab.

Hmm. I see. I am actually a Vim novice although I first used Vim 9 years ago,
I havent used it so much after that but I am learning it now :)

--
Bora Sahin


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Different buffer list for different tabs?

Christopher Suter

On Sun, Oct 11, 2009 at 6:32 PM, <[hidden email]> wrote:


> Saluton :)

Salute :)

> <[hidden email]> skribis:
> > What I would like to do is to work on different projects in the same
> > Vim program. As far as I know a tab page holds a group of windows, not
> > a buffer list but I am wondering if I can use one tab for one project
> > and the other tab for the other project so each project has different
> > buffer lists. Maybe a tab isnt the right way but is there a way to
> > achieve this or is it completely against the Vim philosophy?
>
> I don't know if this is against Vim philosophy (or policy, or just
> "unvimmie") but I think it would be useful.
>
> Anyway, why do you need separated buffer lists?

Think a scenario like that: a main project consisting of smaller relatively
independent projects. Their size differences might not be so huge but
logically they are different so they can be treated separately.

Sometimes I would like to look things up in the main project using cscope or
another way but I dont want them to be seen in the buffer list. Actually from
time to time or maybe mostly in nowadays I have more than 20 buffers open. It
is not so quick to switch between them. So if you can keep them separately in
one vim instance, buffer lists will be specific to each of them. Then you can
use tab commands or whatever it is to switch between different projects and
you have clean buffer lists and hopefully smaller. Although I heard
BufExplorer, I havent tried it yet. I am not sure if it can address the
problem I described.

> I see problems, though, like ":bufdo" on such a tab.

Hmm. I see. I am actually a Vim novice although I first used Vim 9 years ago,
I havent used it so much after that but I am learning it now :)

--
Bora Sahin




If you're using a terminal, I strongly suggest trying GNU screen. If not, I strongly suggest trying the terminal (unless you're on Win32, in which case I strongly suggest trying *nix :D)

Seriously, though. I would quit using computers if they took screen away from me. I can't suggest it highly enough.

--
Christopher Suter
www.grooveshark.com

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Different buffer list for different tabs?

Raúl Núñez de Arenas Coronado-2
In reply to this post by borasah

Saluton :)

Sorry for the delay, I missed this email!

<[hidden email]> skribis:

>> > What I would like to do is to work on different projects in the
>> > same Vim program. As far as I know a tab page holds a group of
>> > windows, not a buffer list but I am wondering if I can use one tab
>> > for one project and the other tab for the other project so each
>> > project has different buffer lists. Maybe a tab isnt the right way
>> > but is there a way to achieve this or is it completely against the
>> > Vim philosophy?
>>
>> I don't know if this is against Vim philosophy (or policy, or just
>> "unvimmie") but I think it would be useful.
>>
>> Anyway, why do you need separated buffer lists?
>
> Think a scenario like that: a main project consisting of smaller
> relatively independent projects. Their size differences might not be
> so huge but logically they are different so they can be treated
> separately.

I understand. But the good news is that there are some solutions that
doesn't imply a change in Vim (a change like the one you propose it's
not going to happen, IMHO).

> Sometimes I would like to look things up in the main project using
> cscope or another way but I dont want them to be seen in the buffer
> list. Actually from time to time or maybe mostly in nowadays I have
> more than 20 buffers open. It is not so quick to switch between them.
> So if you can keep them separately in one vim instance, buffer lists
> will be specific to each of them. Then you can use tab commands or
> whatever it is to switch between different projects and you have clean
> buffer lists and hopefully smaller. Although I heard BufExplorer, I
> havent tried it yet. I am not sure if it can address the problem I
> described.

Maybe BufExplorer is the solution, maybe you can go with using GNU
screen or different windows, etc. I'll tell you what do I use when I
need something like you describe and why I use such solution.

In such an scenario I prefer to use multiple Vim instances, all of them
residing in the same terminal emulator: the one I use has some kind of
"tabs", so I can have just one physical terminal window but many
"virtual" terminal windows. This way I have multiple Vim instances on
the same window, more or less like you would have with GNU screen.

I do this only if I need separation between the Vim instances, for
example when I'm working in code and, at the same time, a whole lot of
related documentation. I prefer to have both things separated because in
the code I may do ":bufdo" and I don't want the work to be applied to
documents, too!. On the other hand, if I have a lot of code belonging to
the same project, I prefer to use Vim tabs (if I have to separate some
pieces of the code in my mind) or just no tabs, just a collection of
buffers.

Of course your situation and needs may be different, but fortunately
there are plenty of alternatives, no matter if inside or outside Vim.

Anyway, if you want to consider even more alternatives, take a look at
":help windows". Maybe you can find a solution without resorting to GNU
screen, a terminal emulator or whatnot.

--
Raúl "DervishD" Núñez de Arenas Coronado
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Different buffer list for different tabs?

Tony Mechelynck
In reply to this post by Tim Chase

On 11/10/09 22:24, Tim Chase wrote:

>
>> What I would like to do is to work on different projects in
>> the same Vim program. As far as I know a tab page holds a
>> group of windows, not a buffer list but I am wondering if I
>> can use one tab for one project and the other tab for the
>> other project so each project has different buffer lists.
>> Maybe a tab isnt the right way but is there a way to achieve
>> this or is it completely against the Vim philosophy?
>
> I'm not sure it's so much philosophy, but how the hierarchy is
> defined.  Vim has a hierarchy of
>
>    Vim instances ->
>      Buffers ->
>        Tabs ->
>          Windows
>
> and as Raul notes, inverting that hierarchy (or a piece thereof)
> causes weird behaviors such as the treatment of "bufdo" when
> you're on a tab.
>
> A readily accessible solution is to use multiple vim instances to
> solve the problem.  On the console, this can be done with GNU
> "screen".  In X, my window manager (fluxbox) can group windows
> together in tabbed groups so I can have multiple gvim windows (or
> consoles with [non-g]vim, or any mix thereof) and then use my
> window-manager's tab-management for such purposes.  Since it's at
> the WM level, I can even mix in a console tab for compiling, a
> browser tab such as Dillo for reading online help, etc.  They all
> move/resize/minimize as one window, but I can click between the
> tabs (or use key-chords defined in my ~/.fluxbox/keys).  With
> other WMs, YMMV.
>
> Hope this gives you some ideas,
>
> -tim

On Linux, my window manager (kdm, from the KDE project) allows up to 20
"virtual desktops" (the exact number is a user preference) within a
single X server and winmanager, and Alt-Tab (or Alt-Shift-Tab in the
opposite direction) cycles between windows on a single virtual deskdop
(while Ctrl-Fn goes to virtual desktop n, Ctrl-Tab and Ctrl-Shift-Tab
walk the desktops; or you can click a "desktop thumbnail" for any of the
up-to-20 of them in the taskbar if you are mouse-minded). In addition to
zero or more gvim instances, any number of the programs on any virtual
desktop can of course be a console window, such as xterm, mlterm (which
has true-bidi capabilities known to Vim), or the multitab konsole (with
a separate shell in each konsole tab), a browser window such as
Konqueror, Firefox or SeaMonkey (or Lynx within a terminal),
etc.etc.etc. — each virtual desktop can even have its own "desktop
background" image — so I could say the same as Tim with a different
winmanager.

Best regards,
Tony.
--
"I'd love to go out with you, but I never go out on days that end in
`Y.'"

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---