2

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

~/Work/Project/subjproject/submodule/foo/baa/etc/something/the_file_im_editing.pl

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?

2

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 
      '(("/home/realraptor/Work/Project/subjproject/submodule/foo/baa"
         . "/$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 
      '(("/home/realraptor/Work/Project/subjproject/submodule/foo/baa"
         . "$PROJECT")))

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

| improve this answer | |
  • 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 Dec 2 '17 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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