-----Original Message-----
From: Yue Wu <[email protected]>
To: vim_dev <[email protected]>
Sent: Fri, Oct 21, 2011 7:01 pm
Subject: Re: [feature request] tab with independent buffer list
On Fri, Oct 21, 2011 at 11:10:45PM +0200, Ingo Karkat wrote:
On 21-Oct-2011 22:51, LHB Jr wrote:
> -----Original Message-----
> From: Ingo Karkat <[email protected]>
> To: vim_dev <[email protected]>
> Sent: Fri, Oct 21, 2011 11:02 am
> Subject: Re: [feature request] tab with independent buffer list
>
>
> On 21-Oct-2011 07:32, Yue Wu wrote:
>> Hello, list,
>>
>> As the title, if a tab can have a buffer list independent with
other
>> tabs, then I can use tab to category the buffers, and one tab for
one
>> project.
>
> This is against Vim's model, and therefore unlikely to be
implemented.
However,
> you could write overloaded commands / command-completions (which
commands do
you
> have in mind? :ls, :buf, :sbuf?) in Vimscript that achieve just
that. (And
with
> the cmdalias plugin could even replace the built-in commands).
>
> For example, I have written a custom command that :bdeletes all
buffers
which
> are only visible in the current tab page, so that I can wipe an
entire tab
page
> from my Vim instance.
>
> Alternatively, there are several buffer-management plugins on
vim.org, maybe
> it'll help to investigate those and adapt your style of use?!
>
> -- regards, ingo
>
> --
>
> I don't like this notion that a buffer group is against 'vims
model' .
If it's (further) complicating the mental model a user needs to have,
it's
just
unlikely to be added. Also, a lot of plugins may break because of
this change.
> After a brief perusing of the vim code I noticed that at +1619
> structs.h the following:
>
> /* Two special kinds of buffers:
> 1620 * help buffer - used for help files, won't use a swap
file.
> 1621 * spell buffer - used for spell info, never displayed and
doesn't
have a
> 1622 * file name.
> 1623 */
> 1624 int b_help; /* TRUE for help file buffer
(when set
b_p_bt
> 1625 is "help") */
> 1626 #ifdef FEAT_SPELL
> 1627 int b_spell; /* TRUE for a spell file
buffer, most
fields
> 1628 are not used! Use the
B_SPELL macro
to
> 1629 access b_spell without
#ifdef. */
>
> In short, vim already has special groups of buffers. Normal
buffers, help
> buffers, and spelling buffers.
That's an implementation detail, without much effect to the actual
use. But
right, this may mean that an implementation isn't so difficult.
> Adding a more versatile buffer 'tag' feature accessible to vimscript
> might be worthwhile. I would have to look at the code some more,
> but it might not be such a challenge if already existing
functionality
> is used.
What about the 'buflisted' option: "When this option is set, the
buffer shows
up
in the buffer list." One could (in pure Vimscript) implement a set of
autocmds
on TabLeave/TabEnter that use setbufvar() to toggle the 'buflisted'
option of
the desired buffers, and store the buffers currently "in scope" in a
tab-local
variable. Unless I'm missing something, this would have the desired
effect.
Hi, it will make things too complicated... I think the concept of tag
system for buffers that Ingo mensioned above sounds great, so I can let
one tab show only a/some tag(s) I want. It won't break any plugins if
it's default setting is to show buffers in all tags.
--
Regards,
Yue Wu
State Key laboratory of Natural Products and Functions
Key Laboratory of Modern Chinese Medicines
Department of Traditional Chinese Medicine
China Pharmaceutical University
No.24, Tongjia Xiang Street, Nanjing 210009, China
--
After giving it some thought Yue, I think the way to do this would be
as follows:
:setlocal meta=projectA, groupC
this would add meta info to the buffer,
then use Modeliner <
http://www.vim.org/scripts/script.php?script_id=1477 > or something
like that to store the meta info.
then modify an existing tab browsing script to group files with
different meta in their modelines in different tabs.
Creating a ':setlocal meta' option could probably be circumvented
but that would make it a bit less elegant, and a bit less consistent as
other information stored in modelines can be accessed through vim
commands.
I'll mull over trying to implement this myself.
LHB
--
You received this message from the "vim_dev" 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