Hot answers tagged

17

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 ...


13

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)))


8

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

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-...


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")


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 ...


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

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

* 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 ...


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

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 ...


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

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

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

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

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 ...


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 ...


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

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

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 () ...


2

It looks like the answer is yes, you are right. And there is no cleaner way to deal with it - but see below, for one suggestion. I'd suggest filing an enhancement request that Emacs add a variable for this keymap: M-x report-emacs-bug. You can of course define your own map variable for this, basing its value on the current ibuffer.el code. But that won't ...


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

Following the example of ibuffer-do-eval: (with-eval-after-load "ibuffer" ;; M-x ibuffer-do-open-in-desktop (define-ibuffer-op open-in-desktop () "Call `open-in-desktop' on current or marked buffers." (:opstring "opened" :modifier-p :maybe) (open-in-desktop)) (define-key ibuffer-mode-map (kbd "C-c o") 'ibuffer-do-open-in-desktop)) ...


2

Use vc-refresh-state like this to get rid of the edited vc-state: (defun vc-state-refresh-post-command-hook () "Check if command in `this-command' was executed, then run `vc-refresh-state'" (when (memq this-command '(other-window kill-buffer ido-kill-buffer ido-switch-buffer)) (vc-refresh-state))) (add-hook 'after-save-hook 'vc-refresh-state) ...


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