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.
1 Answer
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-mapafter modifyingcompany-active-map, and how can I avoid this?caisah– caisah2014-11-02 11:11:38 +00:00Commented Nov 2, 2014 at 11:11 - 7
company-active-mapis 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.user227– user2272014-11-02 11:18:48 +00:00Commented Nov 2, 2014 at 11:18