Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to close many buffers by one command in Vim

Tags:

vim

I use Vim in Screen. I run the command

vim <bigFolder> 

I am in stuck, since it does not make sense to close each buffer by

:q 

How can you close all active buffers in Vim, by one command inside Vim?

like image 451
Léo Léopold Hertz 준영 Avatar asked May 03 '09 02:05

Léo Léopold Hertz 준영


People also ask

How do I close multiple buffers in Vim?

Very simply: use the :bd[elete] command. For example, :bd[elete] buf#1 buf#5 buf#3 will delete the buffers 1, 3, and 5.

How do I close all sessions in Vim?

Other ways to exit VimEsc + :x + Enter (Save and exit) Esc + :qa + Enter (Quit all open files) Esc + Shift ZZ (Save and exit) Esc + Shift ZQ (Exit without saving)


1 Answers

The :bufdo command lets you execute a command on all buffers. In this case, you want to run :bufdo bdelete to close all open buffers in one go.

like image 97
sunaku Avatar answered Sep 28 '22 11:09

sunaku