How can I pare down Vim's buffer list to only include active buffers
How can I pare down my buffer list to only include buffers that are currently open in a window/tab?

When I've been running Vim for a long time, the list of buffers revealed by the `:ls` command is too large to work with. Ideally, I would like to delete all of the buffers which are not currently visible in a tab or window by running a custom command such as `:Only`. Can anybody suggest how to achieve this?

It looks like the [`:bdelete`][bd] command can accept a list of buffer numbers, but I'm not sure how to translate the output from `:ls` to a format that can be consumed by the `:bdelete` command. Any help would be appreciated.

[bd]: http://vimdoc.sourceforge.net/htmldoc/windows.html#:bdelete

How can I pare down Vim's buffer list to only include active buffers
===

How can I pare down my buffer list to only include buffers that are currently open in a window/tab?

When I've been running Vim for a long time, the list of buffers revealed by the `:ls` command is too large to work with. Ideally, I would like to delete all of the buffers which are not currently visible in a tab or window by running a custom command such as `:Only`. Can anybody suggest how to achieve this?

It looks like the [`:bdelete`][bd] command can accept a list of buffer numbers, but I'm not sure how to translate the output from `:ls` to a format that can be consumed by the `:bdelete` command. Any help would be appreciated.

[bd]: http://vimdoc.sourceforge.net/htmldoc/windows.html#:bdelete
