Slim helm module

- Keep only the basic configurations
- Code style
This commit is contained in:
toctan 2014-09-07 09:18:44 +08:00
parent 10011d66d0
commit 3dd60e5106

View file

@ -11,7 +11,8 @@
;;; Commentary: ;;; Commentary:
;; Some config for Helm that follows this guide: http://tuhdo.github.io/helm-intro.html ;; Some configuration for Helm following this guide:
;; http://tuhdo.github.io/helm-intro.html
;;; License: ;;; License:
@ -35,51 +36,37 @@
(prelude-require-packages '(helm helm-projectile)) (prelude-require-packages '(helm helm-projectile))
(require 'helm) (require 'helm)
(require 'helm-grep)
(require 'helm-files)
(require 'helm-projectile)
;; must set before helm-config, otherwise helm use default ;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs.
;; prefix "C-x c", which is inconvenient because you can ;; Note: this must be placed before require `helm-config'
;; accidentally pressed "C-x C-c" (defvar helm-command-prefix-key "C-c h")
(setq helm-command-prefix-key "C-c h")
(require 'helm-config) (require 'helm-config)
(require 'helm-files)
(require 'helm-grep)
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) ; rebihnd tab to do persistent action
(define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) ; make TAB works in terminal
(define-key helm-map (kbd "C-z") 'helm-select-action) ; list actions using C-z
(define-key helm-grep-mode-map (kbd "<return>") 'helm-grep-mode-jump-other-window)
(define-key helm-grep-mode-map (kbd "n") 'helm-grep-mode-jump-other-window-forward)
(define-key helm-grep-mode-map (kbd "p") 'helm-grep-mode-jump-other-window-backward)
(when (executable-find "curl") (when (executable-find "curl")
(setq helm-google-suggest-use-curl-p t)) (setq helm-google-suggest-use-curl-p t))
(setq ;; See https://github.com/bbatsov/prelude/pull/670 for a detailed
helm-scroll-amount 4 ; scroll 4 lines other window using M-<next>/M-<prior> ;; discussion of these options.
helm-quick-update t ; do not display invisible candidates (setq helm-quick-update t
helm-ff-search-library-in-sexp t ; search for library in `require' and `declare-function' sexp. helm-split-window-in-side-p t
helm-split-window-default-side 'other ;; open helm buffer in another window helm-buffers-fuzzy-matching t
helm-split-window-in-side-p t ;; open helm buffer inside current window, not occupy whole other window helm-move-to-line-cycle-in-source t
helm-buffers-favorite-modes (append helm-buffers-favorite-modes helm-ff-search-library-in-sexp t
'(picture-mode artist-mode)) helm-ff-file-name-history-use-recentf t)
helm-candidate-number-limit 500 ; limit the number of displayed candidates
helm-ff-file-name-history-use-recentf t
helm-move-to-line-cycle-in-source t ; move to end or beginning of source
; when reaching top or bottom of source.
helm-buffers-fuzzy-matching t ; fuzzy matching buffer names when non-nil
; useful in helm-mini that lists buffers
)
(global-set-key (kbd "C-c h o") 'helm-occur) (define-key helm-command-map (kbd "o") 'helm-occur)
(global-set-key (kbd "C-c h g") 'helm-do-grep) (define-key helm-command-map (kbd "g") 'helm-do-grep)
(global-set-key (kbd "C-c h C-c w") 'helm-wikipedia-suggest) (define-key helm-command-map (kbd "C-c w") 'helm-wikipedia-suggest)
(global-set-key (kbd "C-c h x") 'helm-register) (define-key helm-command-map (kbd "SPC") 'helm-all-mark-rings)
(global-set-key (kbd "C-c h SPC") 'helm-all-mark-rings)
(define-key helm-grep-mode-map (kbd "RET") 'helm-grep-mode-jump-other-window)
(define-key helm-grep-mode-map (kbd "n") 'helm-grep-mode-jump-other-window-forward)
(define-key helm-grep-mode-map (kbd "p") 'helm-grep-mode-jump-other-window-backward)
;; PACKAGE: helm-projectile
(require 'helm-projectile)
(push "Press <C-c p h> to navigate a project in Helm." prelude-tips) (push "Press <C-c p h> to navigate a project in Helm." prelude-tips)
(provide 'prelude-helm) (provide 'prelude-helm)