emacs: company: use C-p and C-n for selecting prev and next
[~bandali/configs] / .emacs.d / init.el
index 3ce4a3d..8036cf2 100644 (file)
@@ -1018,11 +1018,14 @@ This function is intended for use with `ivy-ignore-buffers'."
   (add-to-list 'ivy-ignore-buffers 'b/ivy-ignore-buffer-p)
 
   (ivy-mode 1)
   (add-to-list 'ivy-ignore-buffers 'b/ivy-ignore-buffer-p)
 
   (ivy-mode 1)
-  ;; :custom-face
-  ;; (ivy-minibuffer-match-face-2 ((t (:background "#e99ce8" :weight semi-bold))))
-  ;; (ivy-minibuffer-match-face-3 ((t (:background "#bbbbff" :weight semi-bold))))
-  ;; (ivy-minibuffer-match-face-4 ((t (:background "#ffbbff" :weight semi-bold))))
-)
+  :custom-face
+  (ivy-minibuffer-match-face-2 ((t (:background "#e7e7e7" :weight bold))))
+  (ivy-minibuffer-match-face-3 ((t (:background "#bbbbff" :weight semi-bold))))
+  (ivy-minibuffer-match-face-4 ((t (:background "#ffbbff" :weight semi-bold))))
+  (ivy-current-match ((((class color) (background light))
+                       :background "#d7d7d7" :foreground "black")
+                      (((class color) (background dark))
+                       :background "#65a7e2" :foreground "black"))))
 
 (use-package swiper
   :demand
 
 (use-package swiper
   :demand
@@ -1322,7 +1325,9 @@ This function is intended for use with `ivy-ignore-buffers'."
   :bind
   (:map company-active-map
         ([tab]    . company-complete-common-or-cycle)
   :bind
   (:map company-active-map
         ([tab]    . company-complete-common-or-cycle)
-        ([escape] . company-abort))
+        ([escape] . company-abort)
+        ("C-p"    . company-select-previous-or-abort)
+        ("C-n"    . company-select-next-or-abort))
   :custom
   (company-minimum-prefix-length 1)
   (company-selection-wrap-around t)
   :custom
   (company-minimum-prefix-length 1)
   (company-selection-wrap-around t)