The ctrlp.vim plugin for Vim does not provide a way to delete open buffers and there are no plans to add this functionality.
This plugin has taken that snippet and improved it to add support for marking multiple buffers, in addition to implementing bugfixes.
You'll also need to add the following line to your ~/.vimrc:
This simply adds a user setting to ctrlp itself. If you are already setting
g:ctrlp_buffer_func somewhere in your vimrc, make sure to call
ctrlp_bdelete#init() after that (this plugin won't clobber it, but you may
clobber the plugin initialization if you change
Open ctrlp in buffer mode (c-p c-b), filter as needed, navigate to a buffer you wish to close and press c-@ (c-2). The buffer will be deleted and will disappear from the list.
You may also mark multiple buffers with c-z and then close them all at once with a single press of c-@.
- Fix rendering bug that causes the ctrlp pane to consume the entire window in some cases (sporadic).
- Support a custom mapping instead of c-@.
- Write documentation for Vim