Emacs: List Buffers
What is Buffer
In emacs, every file is shown in a “buffer”. (You can think of “buffer” as opened file or tabbed window without the tab. It's called buffer because back in 1980s, emacs can only display parts of a file.)
List buffers
- Alt+x
list-buffers
【Ctrl+x Ctrl+b】 - List buffers.
- Alt+x
ibuffer
- Improved version of list buffers. It colors the files by type.
Make ibuffer Default
To make ibuffer
default, put the following in your init file:
(defalias 'list-buffers 'ibuffer) ; make ibuffer default
Batch Operation on Buffers
You can do operation in batch to the marked ones. Example:
- Save all unsaved files
- Close all files of a given dir
- Close all Java files
Here's most useful ibuffer
commands.
- m → Mark
- u → Unmark
- * u → Mark unsaved
- S → Save marked buffer
- D → Close marked buffers