buffer-local keybinding for non-major mode map
Opened this issue · 1 comments
matthuszagh commented
Thanks for this terrific package!
Is there a way to set a buffer-local keybinding for a keymap other than the major mode map. I normally use company-complete-selection
for completions, but in eshell-mode I'd like to bind my completion key to company-complete-common
. This completion key needs to be bound in company-active-map
, not eshell-mode-map
. I've tried using local
, but that seems to just be for buffer-local bindings in the major mode map. For instance, I haven't had any luck with this:
(add-hook 'eshell-mode-hook (lambda ()
(general-define-key
:keymaps 'local
"<tab>" 'company-complete-common)))
But, as expected, it does bind tab in eshell-mode-map
.
noctuid commented
You could maybe make company-active-map
buffer local ((make-local-variable 'company-active-map)
in eshell-mode-hook
) and then bind your key in company-active-map
.