Vim: Close All Buffers But This One

vim

How can I close all buffers in Vim except the one I am currently editing?

Best Answer

Try this

bufdo bd

bufdo runs command for all buffers

http://vim.wikia.com/wiki/Run_a_command_in_multiple_buffers