3

I use Spacemacs, and I often use SPC b b to list buffers so that I can kill the buffers I no longer want. Unfortunately, this process takes a while because I have to repeatedly press SPC b b, navigate to a buffer I want to kill, open it, and then hit SPC b d.

I was looking for something that allows me to open up a list of buffers, in a new buffer, and quickly navigate through them and delete them easily. Kind of like Dired (in Evil mode), which allows you to use j and k to navigate through the list of files and D to delete a file.

Does something like this currently exist in Spacemacs, or in some well-known package?

sid-kap
  • 544
  • 1
  • 6
  • 13

3 Answers3

8

What you want is built-in to emacs. Put (require 'ibuffer) in your config file, then bind a key to 'ibuffer:

(global-set-key "\C-x\C-b" 'ibuffer)

Be sure to check out its help documentation. It has a lot of features.

InHarmsWay
  • 1,309
  • 7
  • 8
2

As mentioned, Ibuffer (ibuffer) and Buffer Menu (buffer-menu) are the closest to a Dired-like interface. But you can also list and act on multiple buffers using just completion.

With Icicles, commands that show you buffer names for completion let you use S-<delete> on any number of them to kill those buffer.

Similarly, C-x k (icicle-kill-buffer, in Icicle mode) lets you kill any number of buffers during the same command.

See:

Drew
  • 75,699
  • 9
  • 109
  • 225
0

From HELM Mini (SPC b b), you can do C-c d to kill a buffer without exiting HELM Mini.

sid-kap
  • 544
  • 1
  • 6
  • 13
  • 1
    You can also mark a buffer with C-SPC, so you can mark multiple buffers in the Helm Mini-buffer and then delete them all. This is all built into 'vanilla' spacemacs with helm. – mclear Dec 29 '16 at 04:22
  • @mclear after marking the buffers with C-SPC, how do I kill them? – sid-kap Dec 29 '16 at 22:44
  • 1
    I use Shift-option-D. If you're not on OS X it might be Shift-command-D – mclear Dec 30 '16 at 01:40