Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buffer-local keybinding for non-major mode map #176

Open
matthuszagh opened this issue Dec 10, 2019 · 1 comment
Open

buffer-local keybinding for non-major mode map #176

matthuszagh opened this issue Dec 10, 2019 · 1 comment
Labels

Comments

@matthuszagh
Copy link

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
Copy link
Owner

noctuid commented Jan 8, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants