67 lines
2.1 KiB
EmacsLisp
67 lines
2.1 KiB
EmacsLisp
|
|
|
||
|
|
(defun helm-add-hooks ()
|
||
|
|
(let ((enabled-modes '(c c++ asm java python ocaml lisp gnuplot
|
||
|
|
haskell verilog ruby vhdl tuareg)))
|
||
|
|
(loop for m in enabled-modes do
|
||
|
|
(add-hook (intern (concat (symbol-name m)
|
||
|
|
"-mode-hook"))
|
||
|
|
'helm-gtags-mode)))
|
||
|
|
|
||
|
|
;; initialize for helm-gtags
|
||
|
|
(with-eval-after-load 'helm-gtags
|
||
|
|
(define-key helm-gtags-mode-map
|
||
|
|
(kbd "M-t") 'helm-gtags-find-tag)
|
||
|
|
(define-key helm-gtags-mode-map
|
||
|
|
(kbd "M-r") 'helm-gtags-find-rtag)
|
||
|
|
(define-key helm-gtags-mode-map
|
||
|
|
(kbd "M-s") 'helm-gtags-find-symbol)
|
||
|
|
(define-key helm-gtags-mode-map
|
||
|
|
(kbd "M-p") 'helm-gtags-find-pattern)
|
||
|
|
(define-key helm-gtags-mode-map
|
||
|
|
(kbd "M-g M-p") 'helm-gtags-parse-file)
|
||
|
|
(define-key helm-gtags-mode-map
|
||
|
|
(kbd "C-c <") 'helm-gtags-previous-history)
|
||
|
|
(define-key helm-gtags-mode-map
|
||
|
|
(kbd "C-c >") 'helm-gtags-next-history)
|
||
|
|
(define-key helm-gtags-mode-map
|
||
|
|
(kbd "C-c r") 'helm-gtags-resume)
|
||
|
|
(define-key helm-gtags-mode-map
|
||
|
|
(kbd "M-,") 'helm-gtags-pop-stack)))
|
||
|
|
|
||
|
|
(defun helm-conf ()
|
||
|
|
(require 'helm-config)
|
||
|
|
(helm-mode 1)
|
||
|
|
(define-key global-map
|
||
|
|
[remap find-file] 'helm-find-files)
|
||
|
|
(define-key global-map
|
||
|
|
[remap occur] 'helm-occur)
|
||
|
|
(define-key global-map
|
||
|
|
[remap list-buffers] 'helm-buffers-list)
|
||
|
|
(define-key global-map
|
||
|
|
[remap dabbrev-expand] 'helm-dabbrev)
|
||
|
|
|
||
|
|
(global-set-key (kbd "M-x") 'helm-M-x)
|
||
|
|
(global-set-key (kbd "C-c <tab>") 'helm-yas-complete)
|
||
|
|
|
||
|
|
(unless (boundp 'completion-in-region-function)
|
||
|
|
(define-key lisp-interaction-mode-map
|
||
|
|
[remap completion-at-point]
|
||
|
|
'helm-lisp-completion-at-point)
|
||
|
|
(define-key emacs-lisp-mode-map
|
||
|
|
[remap completion-at-point]
|
||
|
|
'helm-lisp-completion-at-point))
|
||
|
|
(helm-add-hooks))
|
||
|
|
|
||
|
|
(register-mypkg
|
||
|
|
(list :name "helm"
|
||
|
|
:enabled t
|
||
|
|
:packages '(bind-key async yasnippet helm helm-core
|
||
|
|
helm-descbinds helm-proc
|
||
|
|
helm-gtags helm-git helm-flycheck
|
||
|
|
helm-flyspell helm-flymake helm-fuzzier
|
||
|
|
helm-fuzzy-find helm-ack helm-c-yasnippet
|
||
|
|
helm-themes helm-package helm-ls-git)
|
||
|
|
:config #'(lambda ()
|
||
|
|
(helm-conf))))
|
||
|
|
|