Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

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
    
It's also possible to simply use customize to alter the ibuffer-formats variable for the current and future sessions. – vschum Jul 20 at 17:34

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.