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.
27 (run-with-idle-timer 0.3 nil
#'require
'ivy
)
28 (with-eval-after-load 'ivy
32 ivy-use-virtual-buffers t
33 ivy-virtual-abbreviate
'abbreviate
34 ivy-count-format
"%d/%d ")
36 (defvar b
/ivy-ignore-buffer-modes
40 (defun b/ivy-ignore-buffer-p
(str)
41 "Return non-nil if str names a buffer with a major mode
42 derived from one of `b/ivy-ignore-buffer-modes'.
44 This function is intended for use with `ivy-ignore-buffers'."
45 (let* ((buf (get-buffer str
))
46 (mode (and buf
(buffer-local-value 'major-mode buf
))))
48 (apply #'provided-mode-derived-p mode b
/ivy-ignore-buffer-modes
))))
49 (add-to-list 'ivy-ignore-buffers
#'b
/ivy-ignore-buffer-p
)
51 (define-key ivy-minibuffer-map
[escape] #'keyboard-escape-quit)
52 (define-key ivy-minibuffer-map [S-up]
53 #'ivy-previous-history-element)
54 (define-key ivy-minibuffer-map [S-down]
55 #'ivy-next-history-element)
56 (define-key ivy-minibuffer-map (kbd "DEL")
57 #'ivy-backward-delete-char)
63 (global-set-key (kbd "C-S-s") #'swiper-isearch)
68 (defalias 'locate #'counsel-locate)
69 (global-set-key (kbd "C-c f r") #'counsel-recentf)
70 (define-key minibuffer-local-map
71 (kbd "C-r") #'counsel-minibuffer-history))
73 (provide 'bandali-ivy)
74 ;;; bandali-ivy.el ends here