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
46 (defun b/ivy-ignore-buffer-p (str)
47 "Return non-nil if str names a buffer with a major mode
48 derived from one of `b/ivy-ignore-buffer-modes'.
50 This function is intended for use with `ivy-ignore-buffers'."
51 (let* ((buf (get-buffer str))
52 (mode (and buf (buffer-local-value 'major-mode buf))))
54 (apply #'provided-mode-derived-p mode b/ivy-ignore-buffer-modes))))
55 (add-to-list 'ivy-ignore-buffers 'b/ivy-ignore-buffer-p)
62 :bind (("C-S-s" . swiper-isearch)))
67 :bind (("C-c f r" . counsel-recentf)
68 :map minibuffer-local-map
69 ("C-r" . counsel-minibuffer-history))
72 (defalias 'locate #'counsel-locate))
74 (provide 'bandali-ivy)
75 ;;; bandali-ivy.el ends here