Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is it possible to change the column width in an emacs Ibuffer on the fly?

share|improve this question
add comment

1 Answer

Change the value of ibuffer-formats to what you want, then switch back to the ibuffer window and press 'g'. ibuffer-update will notice the format change and do the right thing. C-h v ibuffer-formats RET will bring up documentation for the variable.

Example:

(setq ibuffer-formats
      '((mark modified read-only " "
              (name 18 18 :left :elide) " "
              (size 9 -1 :right) " "
              (mode 16 16 :left :elide) " " filename-and-process)
        (mark " " (name 16 -1) " " filename)))

You could put this into your .emacs file for easy modification later. If you wanted the name column to be wider, you would edit your .emacs file and change the 18's above into something else:

(setq ibuffer-formats
      '((mark modified read-only " "
              (name 30 30 :left :elide) " "
              (size 9 -1 :right) " "
              (mode 16 16 :left :elide) " " filename-and-process)
        (mark " " (name 16 -1) " " filename)))

Then put the cursor on the line just after the above and type C-x C-e to evaluate the (setq ...) expression and the value of ibuffer-formats will be changed.

share|improve this answer
    
Thanks, could you include an example which makes clear which syntax to use for the ibuffer-formats variable? –  student Apr 7 '12 at 8:16
    
I've added an example. –  Kyle Jones Apr 7 '12 at 17:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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