Hot answers tagged

19

As @Sigma's answer mentions, you need to customize ibuffer-formats. The docstring gives a lot of details about how to modify it by hand, and also notes that you can use the customize machinery to tinker with it. If you prefer the elisp approach, you can adapt the default settings to your taste, with the numbers after the name component of the list ...


14

Running the command ibuffer-auto-mode in an Ibuffer buffer makes it refresh the display after each interactive command. There doesn't appear to be a direct way of activating it automatically. You can put this in your init file: (add-hook 'ibuffer-mode-hook (lambda () (ibuffer-auto-mode 1)))


9

The right way to do it is to introduce support in ibuffer for auto-revert-mode. This can be achieved by defining buffer-stale-function for those those buffers. Arguably, since buffer-menu supports that feature, it'd be good to have it upstream for ibuffer too, but that doesn't seem to be the case for now. Anyway, here's a way to do it: (defun my-ibuffer-...


9

Modify selected Ibuffer buffers After recording the keyboard macro, switch to Ibuffer and, Mark the desired buffers using m Hit W - Eval while viewing buffer (The plain eval E does NOT work for macro calls) (kmacro-end-or-call-macro 1)


8

* means the buffer has been modified, and % means it is read-only. (Comments here corrected my initial misstatement that * means the buffer is marked for subsequent action. The character used for that is >, not `*.) Comments here also mention, as a reminder, that the same characters * and % are used in the mode-line to indicate that a buffer has been ...


7

If all you want is to hide *dired* buffers from ibuffer, just add this to your .emacs :- (add-to-list 'ibuffer-never-show-predicates "^\\*dired")


7

You can set the buffer-predicate parameter of a frame to a function that decides which buffers you want to see in the cycle for windows in that frame. For example, say that you want to see only buffers that are associated to a file. The function buffer-file-name returns nil for buffers that are not associated to files and a non-nil value (the filename) for ...


6

Here are four (4) sample custom display-buffer family of functions that can be custom tailored to suit a user's particular needs -- above; below; left; right -- and here are four (4) interactive functions to display the file or directory of the current line of a dired-mode buffer. There are only three conditions: (a) if there is already a window displaying ...


6

It is not a bug. helm.el does not provide any major mode for helm buffers. So they are infact in fundamental-mode. However it does set the variable mode-name to Helm which is what you are seeing in the mode column. The mode-name variable is a buffer local variable that can contain a user friendly name for the buffer's major-mode and is/can be different from ...


5

There are a few variables that determine the state in which Evil starts depending on the major-mode: evil-emacs-state-modes for major-modes coming up in emacs state evil-insert-state-modes for major-modes coming up in insert state and so on. By default ibuffer-mode is part of evil-emacs-state-modes, which you should remove (setq evil-emacs-state-modes (...


5

You can define filter groups for known projects using something like this: ;; Define ibuffer filter groups for each known project (defun my/define-projectile-filter-groups () (when (boundp 'projectile-known-projects) (setq my/project-filter-groups (mapcar (lambda (it) (let ((name (file-name-nondirectory (directory-file-...


5

Project is meant in the Projectile sense of the word. Using Projectile, there is a way to switch to a buffer inside a specific project C-c p b May I suggest ibuffer-vc? A way to group your buffers by their parent vc root directory.


5

If what you care about is seeing the entire buffer-name column, specifically, you can do it without "customising" anything, by using ibuffer-switch-format, bound to ` within ibuffer. The function switches between the alternatives specified by ibuffer-formats. By defaults ibuffer-formats has two options: ((mark modified read-only locked " " (name 18 ...


5

You can customize ibuffer-formats, which allows you to define amongst other things the width of the columns. It also allows you to define several formats, which is convenient for the stuff that you don't want to always display.


4

The predicate is not a function, but a form to be eval'd in the context of each buffer Something like this should work: (defun my-org-agenda-filter () (let ((fname (buffer-file-name))) (and fname (member (file-truename fname) (mapcar 'file-truename (org-agenda-files)))))) (setq-default ibuffer-saved-filter-groups ...


4

TL;DR Emacs Prelude binds C-xC-b to ibuffer. What T does in the *Buffer List* buffer, /v does in the *Ibuffer* buffer. This filter was only added in Emacs 26, however, so before that you have to emulate it: /fRET will filter by buffers associated with a file, but this does not exclude all special buffers, such as Magit buffers. You can then, for example, ...


3

Your question is unclear, and so risks being closed. Do you have two frames or a single frame with two Emacs windows? Whatever they are, if there are two, is each of them split vertically? And just what do you mean by "split vertically"? What do you mean by a "pane"? What do you mean by "it", in "have it open in pane A"? A wild guess is that you have a ...


3

The search returns to the original buffer when a recursive edit is used for modal searching. But multi-file search doesn't support modal isearch. This problem is fixed in Emacs 24.4 (scheduled to be released next week as I write).


3

Using projectile, you can simply type C-c p I (projectile-ibuffer) and only the buffers for that project will show up in ibuffer.


3

You simply include the buffer-switching in the macro. You're not restricted to a single buffer -- a keyboard macro can do anything you can do! I answered pretty much this same question the other day on S.O., so refer to emacs cross-file keyboard macro.


3

You can modify the variable ibuffer-formats: (setq ibuffer-format-save ibuffer-formats) (setq ibuffer-formats (append ibuffer-formats '((mark " " filename-and-process)))) After this, the backtick character (which runs ibuffer-switch-format) forces redisplay and cycles through the formats specified. In my emacs, after running the above, there are now ...


3

REPOSITORY:  https://github.com/lawlist/buffer-menu CLONE REPO:  git clone https://github.com/lawlist/buffer-menu.git The porting of the Xemacs buffer-menu features to Emacs 26 resulted in the creation of a library consisting of 600+ lines of code. Approximately 99.9 percent of the code is straight from Xemacs, with a few modifications by @lawlist where ...


3

A slightly quicker way that still uses IBuffer, is (from IBuffer) to use % m shell to mark all of the buffers in shell mode, and then press D to delete then all in one go. Depending on what other modes you've got open you might get away with using "sh" instead of shell. I use variations on this quite a lot to kill the many Ag and Dired buffers ...


2

Try this: (setq ibuffer-saved-filter-groups '(("default" ("Ruby" (predicate . (and (eq major-mode 'ruby-mode) (not (string-match-p "spec\\.rb\\'" buffer-file-name))))) ("Specs" (name . "spec\\.rb\\'"))))) Using a more complex check seems ...


2

Not really part of the question, but here's a sorter that sorts by directory. (define-ibuffer-sorter pathname "Sort by pathname" (:description "path") (cl-flet ((get-pathname (data) (with-current-buffer (car data) (or buffer-file-name (if (eq major-mode 'dired-mode) ...


2

M stands for "modified". Emacs will display a star in this column for every buffer that is visiting a modified file.


2

I would assume it stands for Modified. A buffer with unsaved changes will have an asterisk in this column.


2

NOTE:  The following variables are global, which means that they will affect other functions besides dired-find-file-other-window. The user may wish to advice the function at issue so as not to globally affect other functions. [However, this author will leave that option to another forum participant.] Alternatively, there is another answer that this ...


2

You could use a custom filter group, like so: / m dired-mode RET ;Filter by dired-mode / ! ;Negate filter / s non-dired RET ;Save filter as "non-dired" (add-hook 'ibuffer-mode-hook (lambda nil (ibuffer-add-saved-filters "non-dired"))) Note, that you can negate the ...


2

By default ibuffer will sort by recency and start at the first line, which would be the buffer you just came from. Customizing ibuffer -- for example, changing the default sort order -- may result in different behavior. You can define an ibuffer hook to always jump to the most recent buffer with something like this: (defun ibuffer-jump-to-last-buffer () ...


Only top voted, non community-wiki answers of a minimum length are eligible