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.

72 lines
2.5 KiB

  1. ;;; prelude-helm-everywhere.el --- Enable Helm everywhere
  2. ;;
  3. ;; Copyright © 2014-2017 Tu, Do Hoang
  4. ;;
  5. ;; Author: Tu, Do Hoang (tuhdo1710@gmail.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. ;; Enable Helm everywhere with global key bindings to replace common
  12. ;; global bindings and `helm-mode' is activated to replace `completing-read'
  13. ;; with `helm-completing-read-default', so users can use Helm with every prompt.
  14. ;;; License:
  15. ;; This program is free software; you can redistribute it and/or
  16. ;; modify it under the terms of the GNU General Public License
  17. ;; as published by the Free Software Foundation; either version 3
  18. ;; of the License, or (at your option) any later version.
  19. ;;
  20. ;; This program is distributed in the hope that it will be useful,
  21. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. ;; GNU General Public License for more details.
  24. ;;
  25. ;; You should have received a copy of the GNU General Public License
  26. ;; along with GNU Emacs; see the file COPYING. If not, write to the
  27. ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  28. ;; Boston, MA 02110-1301, USA.
  29. ;;; Code:
  30. (require 'prelude-helm)
  31. (prelude-require-packages '(helm-descbinds helm-ag))
  32. (require 'helm-eshell)
  33. (global-set-key (kbd "M-x") 'helm-M-x)
  34. (global-set-key (kbd "C-x C-m") 'helm-M-x)
  35. (global-set-key (kbd "M-y") 'helm-show-kill-ring)
  36. (global-set-key (kbd "C-x b") 'helm-mini)
  37. (global-set-key (kbd "C-x C-b") 'helm-buffers-list)
  38. (global-set-key (kbd "C-x C-f") 'helm-find-files)
  39. (global-set-key (kbd "C-h f") 'helm-apropos)
  40. (global-set-key (kbd "C-h r") 'helm-info-emacs)
  41. (global-set-key (kbd "C-h C-l") 'helm-locate-library)
  42. (define-key prelude-mode-map (kbd "C-c f") 'helm-recentf)
  43. (define-key minibuffer-local-map (kbd "C-c C-l") 'helm-minibuffer-history)
  44. (define-key isearch-mode-map (kbd "C-o") 'helm-occur-from-isearch)
  45. ;; shell history.
  46. (define-key shell-mode-map (kbd "C-c C-l") 'helm-comint-input-ring)
  47. ;; use helm to list eshell history
  48. (add-hook 'eshell-mode-hook
  49. #'(lambda ()
  50. (substitute-key-definition 'eshell-list-history 'helm-eshell-history eshell-mode-map)))
  51. (substitute-key-definition 'find-tag 'helm-etags-select global-map)
  52. (setq projectile-completion-system 'helm)
  53. (helm-descbinds-mode)
  54. (helm-mode 1)
  55. ;; enable Helm version of Projectile with replacment commands
  56. (helm-projectile-on)
  57. (provide 'prelude-helm-everywhere)
  58. ;; prelude-helm-everywhere.el ends here.