Variable: ibuffer-formats

ibuffer-formats is a customizable variable defined in ibuffer.el.gz.

Value

((mark modified read-only locked " "
       (name 18 18 :left :elide)
       " "
       (size 9 -1 :right)
       " "
       (mode 16 16 :left :elide)
       " " filename-and-process)
 (mark " "
       (name 16 -1)
       " " filename)
 (mark erc-modified erc-away erc-op erc-voice " "
       (erc-nick 8 8)
       " "
       (erc-target 18 40)
       (erc-members 5 5 :center)
       (erc-channel-modes 6 16 :center)
       " "
       (erc-server-name 20 30)
       " "
       (erc-topic 10 -1))
 (mark erc-modified erc-away erc-op erc-voice " "
       (erc-target 18 40)
       (erc-members 5 5 :center)
       (erc-channel-modes 9 20 :center)
       " "
       (erc-topic 10 -1)))

Documentation

A list of ways to display buffer lines.

With Ibuffer, you are not limited to displaying just certain attributes of a buffer such as size, name, and mode in a particular order. Through this variable, you can completely customize and control the appearance of an Ibuffer buffer. See also define-ibuffer-column, which allows you to define your own columns for display.

This variable has the form
 ((COLUMN COLUMN ...) (COLUMN COLUMN ...) ...)
Each element in ibuffer-formats should be a list containing COLUMN specifiers. A COLUMN can be any of the following:

  SYMBOL - A symbol naming the column. Predefined columns are:
       mark modified read-only locked name size mode process filename
   When you define your own columns using define-ibuffer-column, just
   use their name like the predefined columns here. This entry can
   also be a function of two arguments, which should return a string.
   The first argument is the buffer object, and the second is the mark
   on that buffer.
 or
  "STRING" - A literal string to display.
 or
  (SYMBOL MIN-SIZE MAX-SIZE &optional ALIGN ELIDE) - SYMBOL is a
   symbol naming the column, and MIN-SIZE and MAX-SIZE are integers (or
   functions of no arguments returning an integer) which constrict the
   size of a column. If MAX-SIZE is -1, there is no upper bound. The
   default values are 0 and -1, respectively. If MIN-SIZE is negative,
   use the end of the string. The optional element ALIGN describes the
   alignment of the column; it can be :left, :center or :right. The
   optional element ELIDE describes whether or not to elide the column
   if it is too long; valid values are :elide and nil. The default is
   nil (don't elide).

Some example of valid entries in ibuffer-formats, with description (also, feel free to try them out, and experiment with your own!):

 (mark " " name)
  This format just displays the current mark (if any) and the name of
  the buffer, separated by a space.
 (mark modified read-only " " (name 16 16 :left) " " (size 6 -1 :right))
  This format displays the current mark (if any), its modification and
  read-only status, as well as the name of the buffer and its size. In
  this format, the name is restricted to 16 characters (longer names
  will be truncated, and shorter names will be padded with spaces), and
  the name is also aligned to the left. The size of the buffer will
  be padded with spaces up to a minimum of six characters, but there is
  no upper limit on its size. The size will also be aligned to the
  right.

Thus, if you wanted to use these two formats, the appropriate value for this variable would be

  '((mark " " name)
    (mark modified read-only
          (name 16 16 :left)
          (size 6 -1 :right)))

Using M-x ibuffer-switch-format (ibuffer-switch-format), you can rotate the display between the specified formats in the list.

This variable was added, or its default value changed, in Emacs 26.1.

Source Code

;; Defined in /usr/src/emacs/lisp/ibuffer.el.gz
(defcustom ibuffer-formats '((mark modified read-only locked
                                   " " (name 18 18 :left :elide)
				   " " (size 9 -1 :right)
				   " " (mode 16 16 :left :elide) " " filename-and-process)
			     (mark " " (name 16 -1) " " filename))
  "A list of ways to display buffer lines.

With Ibuffer, you are not limited to displaying just certain
attributes of a buffer such as size, name, and mode in a particular
order.  Through this variable, you can completely customize and
control the appearance of an Ibuffer buffer.  See also
`define-ibuffer-column', which allows you to define your own columns
for display.

This variable has the form
 ((COLUMN COLUMN ...) (COLUMN COLUMN ...) ...)
Each element in `ibuffer-formats' should be a list containing COLUMN
specifiers.  A COLUMN can be any of the following:

  SYMBOL - A symbol naming the column.  Predefined columns are:
       mark modified read-only locked name size mode process filename
   When you define your own columns using `define-ibuffer-column', just
   use their name like the predefined columns here.  This entry can
   also be a function of two arguments, which should return a string.
   The first argument is the buffer object, and the second is the mark
   on that buffer.
 or
  \"STRING\" - A literal string to display.
 or
  (SYMBOL MIN-SIZE MAX-SIZE &optional ALIGN ELIDE) - SYMBOL is a
   symbol naming the column, and MIN-SIZE and MAX-SIZE are integers (or
   functions of no arguments returning an integer) which constrict the
   size of a column.  If MAX-SIZE is -1, there is no upper bound.  The
   default values are 0 and -1, respectively.  If MIN-SIZE is negative,
   use the end of the string.  The optional element ALIGN describes the
   alignment of the column; it can be :left, :center or :right.  The
   optional element ELIDE describes whether or not to elide the column
   if it is too long; valid values are :elide and nil.  The default is
   nil (don't elide).

Some example of valid entries in `ibuffer-formats', with
description (also, feel free to try them out, and experiment with your
own!):

 (mark \" \" name)
  This format just displays the current mark (if any) and the name of
  the buffer, separated by a space.
 (mark modified read-only \" \" (name 16 16 :left) \" \" (size 6 -1 :right))
  This format displays the current mark (if any), its modification and
  read-only status, as well as the name of the buffer and its size.  In
  this format, the name is restricted to 16 characters (longer names
  will be truncated, and shorter names will be padded with spaces), and
  the name is also aligned to the left.  The size of the buffer will
  be padded with spaces up to a minimum of six characters, but there is
  no upper limit on its size.  The size will also be aligned to the
  right.

Thus, if you wanted to use these two formats, the appropriate
value for this variable would be

  \\='((mark \" \" name)
    (mark modified read-only
          (name 16 16 :left)
          (size 6 -1 :right)))

Using \\[ibuffer-switch-format], you can rotate the display between
the specified formats in the list."
  :version "26.1"
  :type '(repeat sexp))