When I press C-x C-b I get ibuffer (installed as part of prelude I think)

I like to press backtick and get the Filename/Process displayed. Another SE answer helped me with that. (ibuffer hide columns)

I have about a dozen files open, but my work happens in a deeply nested directory. So my ibuffer display is overflowing with all the parent folders information


Nowadays I'm exclusively working inside the ~/Work/Project/subjproject/submodule/ folder. So I buffer don't need to tell me that. It's wasted space to display that.

What can I do about this?

1 Answer 1


I can think of three ways of handling this.

One would be to add a new column type to ibuffer.

A second (which would be system-wide) would be to define a directory alias in directory-mode-alist. Playing with this, the alias needs to start with "/":

(setq directory-abbrev-alist 
         . "/$PROJECT")))

Note that in this case, my experiments show that the alias needs a leading slash. This only affects new buffers: filenames of existing file-visiting buffers are not affected.

A third (which would be confined to ibuffer mode) would be to define a directory alias in ibuffer-directory-abbrev-alist

(setq ibuffer-directory-abbrev-alist 
         . "$PROJECT")))

This doesn't need the leading slash, and takes effect immediately.

  • 1
    The docstring of directory-abbrev-alist explains the need for the leading slash, as well as some other finer points about permitted values.
    – Basil
    Commented Dec 2, 2017 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.