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.

93 lines
3.8 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 helm-descbinds))
  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-eshell)
  36. (require 'helm-files)
  37. (require 'helm-grep)
  38. (define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) ; rebihnd tab to do persistent action
  39. (define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) ; make TAB works in terminal
  40. (define-key helm-map (kbd "C-z") 'helm-select-action) ; list actions using C-z
  41. (define-key helm-grep-mode-map (kbd "<return>") 'helm-grep-mode-jump-other-window)
  42. (define-key helm-grep-mode-map (kbd "n") 'helm-grep-mode-jump-other-window-forward)
  43. (define-key helm-grep-mode-map (kbd "p") 'helm-grep-mode-jump-other-window-backward)
  44. (setq
  45. helm-google-suggest-use-curl-p t
  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-idle-delay 0.01 ; be idle for this many seconds, before updating in delayed sources.
  49. helm-input-idle-delay 0.01 ; be idle for this many seconds, before updating candidate buffer
  50. helm-ff-search-library-in-sexp t ; search for library in `require' and `declare-function' sexp.
  51. helm-split-window-default-side 'other ;; open helm buffer in another window
  52. helm-split-window-in-side-p t ;; open helm buffer inside current window, not occupy whole other window
  53. helm-buffers-favorite-modes (append helm-buffers-favorite-modes
  54. '(picture-mode artist-mode))
  55. helm-candidate-number-limit 500 ; limit the number of displayed canidates
  56. helm-M-x-requires-pattern 0 ; show all candidates when set to 0
  57. helm-ff-file-name-history-use-recentf t
  58. helm-move-to-line-cycle-in-source t ; move to end or beginning of source
  59. ; when reaching top or bottom of source.
  60. ido-use-virtual-buffers t ; Needed in helm-buffers-list
  61. helm-buffers-fuzzy-matching t ; fuzzy matching buffer names when non-nil
  62. ; useful in helm-mini that lists buffers
  63. )
  64. (global-set-key (kbd "C-c h o") 'helm-occur)
  65. (global-set-key (kbd "C-c h g") 'helm-do-grep)
  66. (global-set-key (kbd "C-c h C-c w") 'helm-wikipedia-suggest)
  67. (global-set-key (kbd "C-c h x") 'helm-register)
  68. (global-set-key (kbd "C-c h SPC") 'helm-all-mark-rings)
  69. ;;; Save current position to mark ring
  70. (add-hook 'helm-goto-line-before-hook 'helm-save-current-pos-to-mark-ring)
  71. ;; PACKAGE: helm-projectile
  72. (require 'helm-projectile)
  73. (push "Press <C-c p h> to navigate a project in Helm." prelude-tips)
  74. (provide 'prelude-helm)
  75. ;;; prelude-helm.el ends here