LowCom · 2022-05-14 05:16
I need to click on a buffer in the buffer list menu to open that buffer.
I tried keys f, o, RET(enter) etc but none of them work.
I also want to kill buffers using this buffer list through one command like in dired.
vidbina · 2022-05-14 06:14
💡 Pls be so kind to provide some context such as
- error in Messages buffer,
- description of you config relating to bindings e.g.: are you using Spacemacs, Doom, god-mode, evil, etc. 🤷🏿♂️,
- relevant (probably harder for this problem) screenshot.
1. When you're already in a Buffer List, I would guess `RET` when mapped to `Buffer-menu-this-window` should get the job done. Run `C-h b` (or run the command `describe-bindings`, in case you aren't using original Emacs bindings) and enter "RET" to see if the return is mapped to Buffer-menu-this-window or enter "Buffer-menu-this-window" to find which keybinding your system has configured to it.
2. If the mappings seem to align with your current understanding, try calling `Buffer-menu-this-window` while you already have an item highlighted inside of the Buffer List to verify that it actually opens (you probably already know this but just to be sure `M-x Buffer-menu-this-window`).
3. Repeat for `Buffer-menu-delete` and `Buffer-menu-execute` which would be Buffer List equivalents to Dired's mark and delete. 😉
Alt: consider using `C-x b` default mapped to `switch-to-buffer` and `C-x k` default mapped to `kill-buffer` to directly perform these commands on the focused buffer. Saved you the intermediate trip to Buffer List.
dpoggio · 2022-05-14 06:36
I prefer to use `helm-buffers-list` as I may have dozens of buffers. I bound it to `C-x C-b`. Write any parts of the buffer’s name to narrow the list, open with RET, mark with C-SPC, delete marked with M-D. Other actions available as well, well documented.
LowCom · 2022-05-14 07:07
Oh shit, I am so dumb, thank you.
It wasn't working because I was using evil mode and I am now able to open buffers and delete them.
I wonder why evil-mode doesn't have any bindings for the buffer list. ?
Or does it?
Thanks again.
vidbina · 2022-05-14 07:43
All good. 🤣 Be kind to yourself. 😉 I struggle with seemingly trivial things too often myself. Just yesterday, I was in a fit of rage 🤬 because evil kept changing into a weird state, not realizing that I had accidentally entered `C-z` and didn't know how to exit Emacs state in evil. 🤦🏿♂️🙊😅
There are bindings AFAIk but check that you have the evil-collection https://github.com/emacs-evil/evil-collection loaded to cover as much of your Emacs surface with evil bindings.
As for what the bindings would be: In my setup I use `RET`, `m` or `d` to mark (or mark for deletion) and `x` to execute. Just like I can when evil is handling bindings for my Dired buffers. Just evil + evil-collection at work.
deltille · 2022-05-14 09:14
Play around in ex mode. `:buffers` works (it calls `buffer-menu`) as does `:ls` (is an alias for `:buffers`). You can also call interactive elisp functions by name eg. `:buffers-list` (though you can't include args it seems).
Most of the default ex bindings are in evil-maps.el.
ETA: I just realized your issue is with the buffer-list *itself* not having evil bindings, derp. Leaving my note up for someone else who might google this, but that's always bugged me too. Look into evil-collection, they add evil bindings to a lot of modes, I don't see one for buffer-list but there is one for ibuffer. https://github.com/emacs-evil/evil-collection