emacs - define C-n C-p select candidates
authorPeng Li <seudut@gmail.com>
Sat, 3 Sep 2016 18:37:09 +0000 (02:37 +0800)
committerPeng Li <seudut@gmail.com>
Sat, 3 Sep 2016 18:37:09 +0000 (02:37 +0800)
emacs.d/config.org

index b176144..dfe5e6e 100644 (file)
@@ -1666,14 +1666,18 @@ here on Mac, just use "open" commands to pen =.pdf=,  =.html= and image files
 #+END_SRC
 
 * Completion
-company mode and company-statistics
+** company mode and company-statistics
 #+BEGIN_SRC emacs-lisp :tangle yes :results silent
   (use-package company
     :ensure t
     :diminish company-mode
     :init (setq company-idle-delay 0.1)
     :config
-    (global-company-mode))
+    (global-company-mode)
+    (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))
 
   (use-package company-statistics
     :ensure t