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.

87 lines
3.4 KiB

  1. ;;; prelude-helm.el --- Helm setup
  2. ;;
  3. ;; Copyright © 2011-2014 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. ;; Some config for Helm that follows thiks guide: http://tuhdo.github.io/helm-intro.html
  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 '(helm helm-projectile))
  29. (require 'helm)
  30. ;; must set before helm-config, otherwise helm use default
  31. ;; prefix "C-x c", which is inconvenient because you can
  32. ;; accidentially pressed "C-x C-c"
  33. (setq helm-command-prefix-key "C-c h")
  34. (require 'helm-config)
  35. (require 'helm-files)
  36. (require 'helm-grep)
  37. (define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) ; rebihnd tab to do persistent action
  38. (define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) ; make TAB works in terminal
  39. (define-key helm-map (kbd "C-z") 'helm-select-action) ; list actions using C-z
  40. (define-key helm-grep-mode-map (kbd "<return>") 'helm-grep-mode-jump-other-window)
  41. (define-key helm-grep-mode-map (kbd "n") 'helm-grep-mode-jump-other-window-forward)
  42. (define-key helm-grep-mode-map (kbd "p") 'helm-grep-mode-jump-other-window-backward)
  43. (when (executable-find "curl")
  44. (setq helm-google-suggest-use-curl-p t))
  45. (setq
  46. helm-scroll-amount 4 ; scroll 4 lines other window using M-<next>/M-<prior>
  47. helm-quick-update t ; do not display invisible candidates
  48. helm-ff-search-library-in-sexp t ; search for library in `require' and `declare-function' sexp.
  49. helm-split-window-default-side 'other ;; open helm buffer in another window
  50. helm-split-window-in-side-p t ;; open helm buffer inside current window, not occupy whole other window
  51. helm-buffers-favorite-modes (append helm-buffers-favorite-modes
  52. '(picture-mode artist-mode))
  53. helm-candidate-number-limit 500 ; limit the number of displayed canidates
  54. helm-ff-file-name-history-use-recentf t
  55. helm-move-to-line-cycle-in-source t ; move to end or beginning of source
  56. ; when reaching top or bottom of source.
  57. helm-buffers-fuzzy-matching t ; fuzzy matching buffer names when non-nil
  58. ; useful in helm-mini that lists buffers
  59. )
  60. (global-set-key (kbd "C-c h o") 'helm-occur)
  61. (global-set-key (kbd "C-c h g") 'helm-do-grep)
  62. (global-set-key (kbd "C-c h C-c w") 'helm-wikipedia-suggest)
  63. (global-set-key (kbd "C-c h x") 'helm-register)
  64. (global-set-key (kbd "C-c h SPC") 'helm-all-mark-rings)
  65. ;; PACKAGE: helm-projectile
  66. (require 'helm-projectile)
  67. (push "Press <C-c p h> to navigate a project in Helm." prelude-tips)
  68. (provide 'prelude-helm)
  69. ;;; prelude-helm.el ends here