summaryrefslogtreecommitdiffstats
path: root/lisp/bandali-ivy.el
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2020-04-12 14:38:15 -0400
committerAmin Bandali <bandali@gnu.org>2020-04-12 14:38:15 -0400
commit679463c61523f4eed0ab40468e9504166863e4ac (patch)
treea354c179d17459d234b2f94a3f57f0b3dc6ae648 /lisp/bandali-ivy.el
parent97141042900a4675b2fb9c8bef6bcae6c69c7f1e (diff)
downloadconfigs-679463c61523f4eed0ab40468e9504166863e4ac.tar.gz
configs-679463c61523f4eed0ab40468e9504166863e4ac.tar.xz
configs-679463c61523f4eed0ab40468e9504166863e4ac.zip
Move dired, eshell, ibuffer, ido, and ivy to separate files in lisp/
Diffstat (limited to 'lisp/bandali-ivy.el')
-rw-r--r--lisp/bandali-ivy.el54
1 files changed, 54 insertions, 0 deletions
diff --git a/lisp/bandali-ivy.el b/lisp/bandali-ivy.el
new file mode 100644
index 0000000..763168b
--- /dev/null
+++ b/lisp/bandali-ivy.el
@@ -0,0 +1,54 @@
+(use-package ivy
+ :defer 0.3
+ :bind
+ (:map ivy-minibuffer-map
+ ([escape] . keyboard-escape-quit)
+ ([S-up] . ivy-previous-history-element)
+ ([S-down] . ivy-next-history-element)
+ ("DEL" . ivy-backward-delete-char))
+ :config
+ (setq ivy-wrap t
+ ;; ivy-height 14
+ ivy-use-virtual-buffers t
+ ivy-virtual-abbreviate 'abbreviate
+ ivy-count-format "%d/%d ")
+
+ (defvar b/ivy-ignore-buffer-modes '(magit-mode erc-mode dired-mode))
+ (defun b/ivy-ignore-buffer-p (str)
+ "Return non-nil if str names a buffer with a major mode
+derived from one of `b/ivy-ignore-buffer-modes'.
+
+This function is intended for use with `ivy-ignore-buffers'."
+ (let* ((buf (get-buffer str))
+ (mode (and buf (buffer-local-value 'major-mode buf))))
+ (and mode
+ (apply #'provided-mode-derived-p mode b/ivy-ignore-buffer-modes))))
+ (add-to-list 'ivy-ignore-buffers 'b/ivy-ignore-buffer-p)
+
+ (ivy-mode 1)
+ :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-s" . swiper-isearch)))
+
+(use-package counsel
+ :demand
+ :after ivy
+ :bind (("C-c f r" . counsel-recentf)
+ :map minibuffer-local-map
+ ("C-r" . counsel-minibuffer-history))
+ :config
+ (counsel-mode 1)
+ (defalias 'locate #'counsel-locate))
+
+(provide 'bandali-ivy)