The best buffers list in Emacs: bs-show

How about triggering a popup list of buffers with a keybind, finding your preferred next buffer to go to with arrow keys, and launching it with Enter, which at the same time dismisses the popup list of buffers? This is how bs-show behaves in Emacs.

The main operations of bs-show are so simple that they do not need any describing. For a quick switch to a different buffer, bs-show beats list-buffers and ibuffer. Therefore:

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

However, there are some defaults that need to be changed. First, the default display of bs-show lists files only, not other open buffers, such as *scratch*. To change this, open up M-x customize-group RET bs. In the Customize Group buffer there are three places that say “Configuration”. The most important is the third one, “Bs Default Configuration”. This is by default configured as files. Other values to put there are files-and-scratch to add *scratch* buffer to the list, all for all buffers and all-intern-last for all buffers sorted by files first. Your favourite will presumably be all or all-intern-last.

Another option in the Customize Group buffer is “Bs Alternative Configuration”. This is the configuration that opens up by C-u M-x bs-show. I have changed this value to files. Then press “Apply and Save”.

One last thing. The cursor in bs-show buffer is by default at the latest focused buffer. This may be desirable or not. One might prefer the cursor on the first line of the list or at least an easy way to get to the first line and then move on from there. Without any further configuring, the way to get to the first item on the list in bs-show buffer is M-: (goto-line 3).

Leave a Reply

Your email address will not be published. Required fields are marked *