kalbasit
kalbasit

Reputation: 774

vim - howto close all buffers in the current tab?

I know that using a command like:

:%bdelete

Using this command I can close all buffers, in all tabs, what I'd like to do is to close all buffers open in the current tab, is that possible?

Usage:

What I'd like to do, is to open ViM and load :VSTreeExplorer and then open related files in the same window switching between them using :next and :previous and then open other files a new tab (with VSTreeExplorer as well), when I need to clean one of the tabs, I would like to use whatever command that closes buffers in the current tab.

For now, what I do is use :%bd and then open the VSTreeExplorer and start over...

Thanks

Upvotes: 17

Views: 8614

Answers (3)

Kelly Stannard
Kelly Stannard

Reputation: 351

:windo bd will delete all buffers in the current tab.

Upvotes: 20

too much php
too much php

Reputation: 91068

If you're done with a tab you can just use :tabclose.

Upvotes: 18

jamessan
jamessan

Reputation: 42747

Buffers are global to the Vim instance, not confined to a specific tab page. A tab page is simply a way to organize windows and windows are simply a way to display a buffer. Zero or more windows (and therefore tab pages) can display the same buffer. Getting used to this concept should help your workflow in Vim.

The Vim wiki has a couple pages that give some more explanation and tips for using tab pages.

Upvotes: 6

Related Questions