Group buffers in Emacs ibuffer-mode by their projectile root directory
Switch branches/tags
Nothing to show
Clone or download
Latest commit 7649621 Dec 2, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md Add a project-relative-file column definition Nov 28, 2018
ibuffer-projectile.el Fix header metadata Dec 2, 2018

README.md

Melpa Status Melpa Stable Status Support me

ibuffer-projectile: Group buffers in ibuffer list by projectile project

Emacs' ibuffer-mode is a wonderful replacement for the built-in list-buffer command, and allows buffers to be grouped programatically, e.g. by major mode.

ibuffer-projectile lets you group your buffers by their projectile root directory.

You can use this package manually or automatically. For manual use, call ibuffer-projectile-set-filter-groups. To have this function called when you open ibuffer, add this hook to your configuration:

(add-hook 'ibuffer-hook
    (lambda ()
      (ibuffer-projectile-set-filter-groups)
      (unless (eq ibuffer-sorting-mode 'alphabetic)
        (ibuffer-do-sort-by-alphabetic))))

Alternatively, use `ibuffer-projectile-generate-filter-groups' to programmatically obtain a list of filter groups that you can combine with your own custom groups.

To display filenames relative to the project root, use project-relative-file in ibuffer-formats, e.g.:

(setq ibuffer-formats
      '((mark modified read-only " "
              (name 18 18 :left :elide)
              " "
              (size 9 -1 :right)
              " "
              (mode 16 16 :left :elide)
              " "
              project-relative-file)))

I personally use ibuffer-vc because I prefer its grouping behaviour, but I thought this would be useful to some people too.

How to install

Add ibuffer-projectile.el to your load-path, or (preferred) install from Melpa.


Steve Purcell's blog // @sanityinc on Twitter