ibuffer uses/ as a prefix key for filter commands, likeibuffer-filter-by-name (/n).
As an evil user, I wanted to use a different prefix, since evil uses/ for searching.
I usespace as a leader-key, so I decided to put the filter commands behindspace/.
The ibuffer/ prefix is an anonymous keymap, so I had to bind my new key to the result of alookup-key call:
(bind-map-for-mode-inherit ivan/ibuffer-leader-map ivan/leader-map :major-modes (ibuffer-mode) :bindings ("/" (lookup-key ibuffer-mode-map "/"))) ; <= hereIt works, but is there a cleaner way to do it?
I say it's an anonymous keymap because I wasn't able to find any variable bound to it. Running(lookup-key ibuffer-mode-map "/") just prints out the keymap body:
(keymap (92 . ibuffer-clear-filter-groups) ... (109 . ibuffer-filter-by-used-mode))1 Answer1
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 currentibuffer.el code. But that won't automatically pick up future changes to the Ibuffer code.
In general, I think it is a good idea for prefix keys to have associated keymap variables. That makes it easy for users to, e.g., move such a map to a different prefix key.
- 1I liked your suggestion. I just filed an enhancement request.ivan– ivan2017-02-19 19:18:49 +00:00CommentedFeb 19, 2017 at 19:18
Explore related questions
See similar questions with these tags.
