/bufferbin

Primary LanguageEmacs LispGNU General Public License v3.0GPL-3.0

https://melpa.org/packages/bufferbin-badge.svg

Bufferbin

bufferbin.png Bufferbin is a small tool to provide visibility and control over buffers. Using Treemacs as inspiration, it resides in a side-window that lists available buffers and enables mouse-movements to open them in selected windows.

There are two ways to open buffers:

  1. Single click on the buffer name, then single click in the desired window, or
  2. Drag the buffer name from the Bufferbin to the desired window.

Quick Start

Install the Bufferbin package, then type M-x bufferbin to initialize and open the tool.

The following keymaps are provided by default for the Bufferbin window:

KeyActionDescription
qBury BufferbinHide the Bufferbin window, but keep the tool active
kClose BufferbinClose the Bufferbin tool completely
fAdd filterAdd a regex filter to the Bufferbin list
rReset filterRemove current filters
RETRefresh listManually refresh list of buffers

Then, to open a buffer with the mouse:

Option 1 (two mouse clicks)
First mouse clickSelect buffer to open
Second mouse clickSelect window and open the buffer
Option 2 (mouse drag)
Mouse dragClick on buffer and drag to desired window

Details

Bufferbin is designed for users that prefer visiblity over existing buffers and the ability to quickly open them with the mouse. The tool does not attempt to bind buffers to specific windows and ‘tabify’ them like VS Code. Instead, it provides flexibility to assign buffers to any window, as necessary. Bufferbin’s side-window can also be buried when screen real-estate becomes precious and easily revealed again with a simple key binding.

Fontfaces

Bufferbin assigns fontfaces to buffers based on their major mode. See additional details on bufferbin-mode-fonts in the Configuration section below.

Ignore

Bufferbin can ignore buffers based on Regular Expressions. For instance, buffers beginning with a space are ignored by default. The user can add additional regex’s to bufferbin-ignore-regex (see Configuration below).

Filtering

Users can filter buffers in real-time using the f keybinding. Simply enter a regular expression to reveal just the buffers that satisfy the regex. You can add as many regex’s as you want. When done, just hit r to remove the filters.

Installation

Manual installaion via Github

Download source code bufferbin.el. Add the following to your config (with the appropriate path to the file):

(load "bufferbin.el")
(global-set-key (kbd "C-c b") 'bufferbin)

Installing with package-install

M-x package-install RET bufferbin RET

Then add the following to your config:

(global-set-key (kbd "C-c b") 'bufferbin)

Installing with use-package

(use-package bufferbin
  :ensure t
  :bind  (("C-c b" . bufferbin)))

Configuration

Fontfaces

To assign fontfaces to major modes, insert the following into your config and modify the alist accordingly (this is just an example).

(add-to-list 'bufferbin-mode-fonts '(c-mode . gnus-header-content)
(add-to-list 'bufferbin-mode-fonts '(org-mode . font-lock-type-face))
(add-to-list 'bufferbin-mode-fonts '(magit-status-mode . font-lock-comment-face))

Ignore List

Similarly, you can add regex’s to the ignore list like this:

;; ignore anything beginning with an asterix
(add-to-list 'bufferbin-ignore-regex '("^*")