ibuffer-mode
ibuffer-mode is an interactive compiled Lisp function in `ibuffer.el
'.
(ibuffer-mode)
Parent mode: `special-mode'.
A major mode for viewing a list of buffers.
In Ibuffer, you can conveniently perform many operations on the
currently open buffers, in addition to filtering your view to a
particular subset of them, and sorting by various criteria.
Operations on marked buffers:
'S' - Save the marked buffers
'A' - View the marked buffers in this frame.
'H' - View the marked buffers in another frame.
'V' - Revert the marked buffers.
'T' - Toggle read-only state of marked buffers.
'D' - Kill the marked buffers.
'M-s a C-s' - Do incremental search in the marked buffers.
'M-s a C-M-s' - Isearch for regexp in the marked buffers.
'U' - Replace by regexp in each of the marked
buffers.
'Q' - Query replace in each of the marked buffers.
'I' - As above, with a regular expression.
'P' - Print the marked buffers.
'O' - List lines in all marked buffers which match
a given regexp (like the function `occur').
'X' - Pipe the contents of the marked
buffers to a shell command.
'N' - Replace the contents of the marked
buffers with the output of a shell command.
'!' - Run a shell command with the
buffer's file as an argument.
'E' - Evaluate a form in each of the marked buffers. This
is a very flexible command. For example, if you want to make all
of the marked buffers read only, try using (read-only-mode 1) as
the input form.
'W' - As above, but view each buffer while the form
is evaluated.
'k' - Remove the marked lines from the *Ibuffer* buffer,
but don't kill the associated buffer.
'x' - Kill all buffers marked for deletion.
Marking commands:
'm' - Mark the buffer at point.
't' - Unmark all currently marked buffers, and mark
all unmarked buffers.
'u' - Unmark the buffer at point.
'DEL' - Unmark the buffer at point, and move to the
previous line.
'M-DEL' - Unmark all marked buffers.
'* M' - Mark buffers by major mode.
'* u' - Mark all "unsaved" buffers.
This means that the buffer is modified, and has an associated file.
'* m' - Mark all modified buffers,
regardless of whether or not they have an associated file.
'* s' - Mark all buffers whose name begins and
ends with '*'.
'* e' - Mark all buffers which have
an associated file, but that file doesn't currently exist.
'* r' - Mark all read-only buffers.
'* /' - Mark buffers in `dired' mode.
'* h' - Mark buffers in `help-mode', `apropos-mode', etc.
'.' - Mark buffers older than `ibuffer-old-time'.
'd' - Mark the buffer at point for deletion.
'% n' - Mark buffers by their name, using a regexp.
'% m' - Mark buffers by their major mode, using a regexp.
'% f' - Mark buffers by their filename, using a regexp.
Filtering commands:
'M-x ibuffer-filter-by-mode' - Add a filter by any major mode.
'/ m' - Add a filter by a major mode now in use.
'/ M' - Add a filter by derived mode.
'/ n' - Add a filter by buffer name.
'/ c' - Add a filter by buffer content.
'/ f' - Add a filter by filename.
'/ >' - Add a filter by buffer size.
'/ <' - Add a filter by buffer size.
'/ e' - Add a filter by an arbitrary Lisp predicate.
'/ s' - Save the current filters with a name.
'/ r' - Switch to previously saved filters.
'/ a' - Add saved filters to current filters.
'/ o' - Replace the top two filters with their logical OR.
'/ p' - Remove the top filter.
'/ !' - Invert the logical sense of the top filter.
'/ d' - Break down the topmost filter.
'/ /' - Remove all filtering currently in effect.
Filter group commands:
'/ g' - Create filter group from filters.
'/ P' - Remove top filter group.
'TAB' - Move to the next filter group.
'M-p' - Move to the previous filter group.
'/ \' - Remove all active filter groups.
'/ S' - Save the current groups with a name.
'/ R' - Restore previously saved groups.
'/ X' - Delete previously saved groups.
Sorting commands:
',' - Rotate between the various sorting modes.
's i' - Reverse the current sorting order.
's a' - Sort the buffers lexicographically.
's f' - Sort the buffers by the file name.
's v' - Sort the buffers by last viewing time.
's s' - Sort the buffers by size.
's m' - Sort the buffers by major mode.
Other commands:
'g' - Regenerate the list of all buffers.
Prefix arg means to toggle whether buffers that match
`ibuffer-maybe-show-predicates' should be displayed.
'`' - Change the current display format.
'SPC' - Move point to the next line.
'C-p' - Move point to the previous line.
'C-h m' - This help.
'=' - View the differences between this buffer
and its associated file.
'RET' - View the buffer on this line.
'o' - As above, but in another window.
'C-o' - As both above, but don't select
the new window.
'b' - Bury (not kill!) the buffer on this line.
** Information on Filtering:
You can filter your ibuffer view via different criteria. Each Ibuffer
buffer has its own stack of active filters. For example, suppose you
are working on an Emacs Lisp project. You can create an Ibuffer
buffer displays buffers in just `emacs-lisp' modes via
'M-x ibuffer-filter-by-mode emacs-lisp-mode RET'. In this case, there
is just one entry on the filtering stack.
You can also combine filters. The various filtering commands push a
new filter onto the stack, and the filters combine to show just
buffers which satisfy ALL criteria on the stack. For example, suppose
you only want to see buffers in `emacs-lisp' mode, whose names begin
with "gnus". You can accomplish this via:
'M-x ibuffer-filter-by-mode emacs-lisp-mode RET
/ n ^gnus RET'.
Additionally, you can OR the top two filters together with
'M-x ibuffer-or-filters'. To see all buffers in either
`emacs-lisp-mode' or `lisp-interaction-mode', type:
'M-x ibuffer-filter-by-mode emacs-lisp-mode RET M-x ibuffer-filter-by-mode lisp-interaction-mode RET M-x ibuffer-or-filters'.
Filters can also be saved and restored using mnemonic names: see the
functions `ibuffer-save-filters' and `ibuffer-switch-to-saved-filters'.
To remove the top filter on the stack, use '/ p', and
to disable all filtering currently in effect, use
'/ /'.
** Filter Groups:
Once one has mastered filters, the next logical step up is "filter
groups". A filter group is basically a named group of buffers which
match a filter, which are displayed together in an Ibuffer buffer. To
create a filter group, simply use the regular functions to create a
filter, and then type '/ g'.
A quick example will make things clearer. Suppose that one wants to
group all of one's Emacs Lisp buffers together. To do this, type
'M-x ibuffer-filter-by-mode emacs-lisp-mode RET / g RET emacs lisp buffers RET'
You may, of course, name the group whatever you want; it doesn't have
to be "emacs lisp buffers". Filter groups may be composed of any
arbitrary combination of filters.
Just like filters themselves, filter groups act as a stack. Buffers
will not be displayed multiple times if they would be included in
multiple filter groups; instead, the first filter group is used. The
filter groups are displayed in this order of precedence.
You may rearrange filter groups by using the regular
'C-k' and 'C-y' pair. Yanked groups
will be inserted before the group at point.
In addition to any hooks its parent mode `special-mode' might have run,
this mode runs the hook `ibuffer-mode-hook', as the final step
during initialization.