Emacs config utilizing prelude as a base
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.5 KiB

  1. ;;; prelude-ivy.el --- Ivy setup
  2. ;;
  3. ;; Copyright © 2011-2020 Bozhidar Batsov
  4. ;;
  5. ;; Author: Bozhidar Batsov <bozhidar@batsov.com>
  6. ;; URL: https://github.com/bbatsov/prelude
  7. ;; This file is not part of GNU Emacs.
  8. ;;; Commentary:
  9. ;; Ivy-related config. Ivy is a smart framework for minibuffer
  10. ;; completion/filtering/selection (think of ido). Swiper and counsel
  11. ;; are two packages built on top of ivy that provide ivy-powered
  12. ;; versions of popular Emacs commands.
  13. ;;; License:
  14. ;; This program is free software; you can redistribute it and/or
  15. ;; modify it under the terms of the GNU General Public License
  16. ;; as published by the Free Software Foundation; either version 3
  17. ;; of the License, or (at your option) any later version.
  18. ;;
  19. ;; This program is distributed in the hope that it will be useful,
  20. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. ;; GNU General Public License for more details.
  23. ;;
  24. ;; You should have received a copy of the GNU General Public License
  25. ;; along with GNU Emacs; see the file COPYING. If not, write to the
  26. ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  27. ;; Boston, MA 02110-1301, USA.
  28. ;;; Code:
  29. (prelude-require-packages '(ivy ivy-prescient swiper counsel))
  30. ;;; Ivy
  31. ;; ivy is a powerful alternative to the popular ido-mode
  32. (require 'ivy)
  33. (require 'ivy-prescient)
  34. (require 'diminish)
  35. (ivy-mode 1)
  36. (setq ivy-use-virtual-buffers t)
  37. (setq enable-recursive-minibuffers t)
  38. (global-set-key (kbd "C-c C-r") 'ivy-resume)
  39. (global-set-key (kbd "<f6>") 'ivy-resume)
  40. ;; smarter filtering and sorting for ivy
  41. (ivy-prescient-mode 1)
  42. (diminish 'ivy-mode)
  43. ;;; Swiper
  44. ;; swiper provides enhanced buffer search
  45. (global-set-key "\C-s" 'swiper)
  46. ;;; Counsel
  47. ;; counsel supercharges a lot of commands with some ivy magic
  48. (global-set-key (kbd "M-x") 'counsel-M-x)
  49. (global-set-key (kbd "C-x C-f") 'counsel-find-file)
  50. (global-set-key (kbd "<f1> f") 'counsel-describe-function)
  51. (global-set-key (kbd "<f1> v") 'counsel-describe-variable)
  52. (global-set-key (kbd "<f1> l") 'counsel-find-library)
  53. (global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
  54. (global-set-key (kbd "<f2> u") 'counsel-unicode-char)
  55. (global-set-key (kbd "C-c g") 'counsel-git)
  56. (global-set-key (kbd "C-c j") 'counsel-git-grep)
  57. (global-set-key (kbd "C-c a") 'counsel-ag)
  58. (global-set-key (kbd "C-x l") 'counsel-locate)
  59. (define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history)
  60. (provide 'prelude-ivy)
  61. ;;; prelude-ivy.el ends here