Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc Update doco for pathogen bundle usage May 10, 2015
plugin Handle BufAdd event Feb 28, 2018
.gitignore Add .gitignore Jun 10, 2017 Merge pull request #6 from meribold/master Sep 24, 2015


In Vim, trying to unload, delete or wipe a buffer without closing the window or split? You'll like this:

With bufkill:

With bufkill

Without bufkill (standard Vim behaviour):

Without bufkill

The inspiration for this script came from:

  • My own frustration with vim's lack of this functionality
  • The description of the emacs kill-buffer command in tip #622 (this script basically duplicates this command I believe, not sure about the undo functionality)
  • Comments by Keith Roberts when the issue was raised in the mailing list.

Note: This is the official Git repo which replaces


This plugin follows the standard runtime path structure, and as such it can be installed with a variety of plugin managers:

  • Pathogen

    • git clone ~/.vim/bundle/vim-bufkill
  • Vundle:

    • Plugin 'qpkorr/vim-bufkill'



When you wish to unload a file from the buffer and keep the window/split intact:


When you wish to delete a file from the buffer and keep the window/split intact:


When you wish to wipe a file from the buffer and keep the window/split intact:


Notice how the key mappings are the uppercase version of the :bun :bd :bw Vim commands? Easy!

Moving through buffers

To move backwards through recently accessed buffers:


and to move forwards:


To move to an alternate buffer and keep the cursor in the same column, use:



You can also override Ctrl-^ (Vim's default for swapping between alternate buffers) via g:BufKillOverrideCtrlCaret in your /.vimrc file.

You can overide the default mappings within your /.vimrc file like so:

map <C-c> :BD<cr>

resulting in being able to delete a file from the buffer via vim-bufkill with CTRL + c


Contributions and pull requests are welcome.

A big thanks to Oli Morris for his excellent rewrite of this README file, and creating the animated gifs.