如何重新映射公司的下一个选择并选择上一个键?


10

我不喜欢默认的M-nM-pcompany-select-nextcompany-select-previous,所以我在想,如果有可能重新映射那些C-nC-p不会影响映射时公司的提示不活跃。

Answers:


21

相应地修改company-active-map

(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))

您知道Symbol's value as variable is void: company-active-map修改后为什么会得到为什么company-active-map,如何避免这种情况?
caisah 2014年

7
company-active-map在明显加载公司之前未定义。加载公司后,您需要评估这些命令,例如使用with-eval-after-load。我相应地更新了我的答案。
lunaryorn 2014年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.