Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim - howto close all buffers in the current tab?

Tags:

vim

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

like image 401
kalbasit Avatar asked Jun 28 '10 14:06

kalbasit


People also ask

How do I close all buffers in vim?

I use a variant of your solution: :%bd<CR><C-O>:bd#<CR> This will delete all buffers, then use <C-O> to get restore the position in the current file, then :bd# to remove the unamed buffer. This closes all buffers and leaves you in the same location in the file.

How do you close a tab in vim?

Remap :tabclose to QA This plugin will allow you to keep your abbreviations in the context of a : command. Once this plugin is loaded add the following to your vimrc to create a user command for QA . Now typing :qa in a tab will close out the tab.

How do we save and quit for all active tabs vim?

It's possible to suffix a[ll] for a number of Vim command-line commands (i.e. type : when in normal mode), include: :wa - save all tabs / unsaved buffers. :xa / :wqa - save all tabs / unsaved buffers and exit Vim. :qa - exit vim (will warn if unsaved buffers exist)


1 Answers

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

like image 58
too much php Avatar answered Oct 05 '22 23:10

too much php