4a88a1319f3cef47183269873a44fbd384469962
1 ;;; bandali-ivy.el --- bandali's Ivy setup -*- lexical-binding: t; -*-
3 ;; Copyright (C) 2018-2020 Amin Bandali
5 ;; Author: Amin Bandali <bandali@gnu.org>
8 ;; This program is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
23 ;; My configuration for Ivy and family.
30 (:map ivy-minibuffer-map
31 ([escape] . keyboard-escape-quit)
32 ([S-up] . ivy-previous-history-element)
33 ([S-down] . ivy-next-history-element)
34 ("DEL" . ivy-backward-delete-char))
38 ivy-use-virtual-buffers t
39 ivy-virtual-abbreviate 'abbreviate
40 ivy-count-format "%d/%d ")
42 (defvar b/ivy-ignore-buffer-modes '(magit-mode erc-mode dired-mode))
43 (defun b/ivy-ignore-buffer-p (str)
44 "Return non-nil if str names a buffer with a major mode
45 derived from one of `b/ivy-ignore-buffer-modes'.
47 This function is intended for use with `ivy-ignore-buffers'."
48 (let* ((buf (get-buffer str))
49 (mode (and buf (buffer-local-value 'major-mode buf))))
51 (apply #'provided-mode-derived-p mode b/ivy-ignore-buffer-modes))))
52 (add-to-list 'ivy-ignore-buffers 'b/ivy-ignore-buffer-p)
56 (ivy-minibuffer-match-face-1 ((t (:background "#eeeeee"))))
57 (ivy-minibuffer-match-face-2 ((t (:background "#e7e7e7" :weight bold))))
58 (ivy-minibuffer-match-face-3 ((t (:background "light goldenrod" :weight semi-bold))))
59 (ivy-minibuffer-match-face-4 ((t (:background "misty rose" :weight semi-bold))))
60 (ivy-current-match ((((class color) (background light))
61 :background "#d7d7d7" :foreground "black")
62 (((class color) (background dark))
63 :background "#65a7e2" :foreground "black"))))
68 :bind (("C-S-s" . swiper-isearch)))
73 :bind (("C-c f r" . counsel-recentf)
74 :map minibuffer-local-map
75 ("C-r" . counsel-minibuffer-history))
78 (defalias 'locate #'counsel-locate))
80 (provide 'bandali-ivy)
81 ;;; bandali-ivy.el ends here