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.

70 lines
2.2 KiB

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