emacs: simplify/tweak swiper and counsel use-packages
[~bandali/configs] / .emacs.d / init.el
index 3ce4a3d..06fd31f 100644 (file)
@@ -1018,25 +1018,27 @@ This function is intended for use with `ivy-ignore-buffers'."
   (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-1 ((t (:background "#eeeeee"))))
+  (ivy-minibuffer-match-face-2 ((t (:background "#e7e7e7" :weight bold))))
+  (ivy-minibuffer-match-face-3 ((t (:background "light goldenrod" :weight semi-bold))))
+  (ivy-minibuffer-match-face-4 ((t (:background "misty rose" :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
   :after ivy
-  :bind (("C-s"   . swiper-isearch)
-         ("C-r"   . swiper-isearch-backward)
-         ("C-S-s" . swiper-isearch)))
+  :bind (("C-S-s" . swiper-isearch)))
 
 (use-package counsel
-  :bind (;; ([remap execute-extended-command] . counsel-M-x)
-         ;; ([remap find-file]                . counsel-find-file)
-         ("C-c f r" . counsel-recentf)
+  :demand
+  :after ivy
+  :bind (("C-c f r" . counsel-recentf)
          :map minibuffer-local-map
-              ("C-r" . counsel-minibuffer-history))
+         ("C-r" . counsel-minibuffer-history))
   :config
   (counsel-mode 1)
   (defalias 'locate #'counsel-locate))
@@ -1322,7 +1324,9 @@ This function is intended for use with `ivy-ignore-buffers'."
   :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)
@@ -1772,7 +1776,7 @@ This function is intended for use with `ivy-ignore-buffers'."
        (advice-add 'magit-branch-and-checkout
                    :after #'my-projectile-invalidate-cache)))
   :custom
-  ;; (projectile-completion-system 'ivy)
+  (projectile-completion-system 'ivy)
   (projectile-mode-line-prefix " proj"))
 
 (use-package helpful
@@ -2696,7 +2700,7 @@ https://csclub.uwaterloo.ca/~abandali")
 (use-feature erc-pcomplete
   :after erc
   :custom
-  (erc-pcomplete-nick-postfix ","))
+  (erc-pcomplete-nick-postfix ", "))
 
 (use-feature erc-track
   :after erc