I don't like the default M-n and M-p keys for company-select-next
and company-select-previous
so I was wondering if it's possible to remap those to C-n and C-p without affecting the mappings when company's tooltip is not active.
10
21
Modify company-active-map
accordingly:
(with-eval-after-load 'company
(define-key company-active-map (kbd "M-n") nil)
(define-key company-active-map (kbd "M-p") nil)
(define-key company-active-map (kbd "C-n") #'company-select-next)
(define-key company-active-map (kbd "C-p") #'company-select-previous))
-
Do you know why do I get
Symbol's value as variable is void: company-active-map
after modifyingcompany-active-map
, and how can I avoid this? – caisah Nov 2 '14 at 11:11 -
7
company-active-map
is not defined before company is loaded obviously. You need to evaluate these commands after company was loaded, e.g. withwith-eval-after-load
. I updated my answer accordingly. – lunaryorn Nov 2 '14 at 11:18