1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-09-20 02:31:42 +00:00
dotfiles/emacs.d/config/config-helm.el

81 lines
3.2 KiB
EmacsLisp
Raw Normal View History

2015-04-06 21:35:55 +00:00
;;; config-file -- Helm configuration
;;; Commentary:
;;; The slowest part is actually loading helm-projectile
;;; Code:
2015-03-24 21:58:59 +00:00
2015-04-06 21:35:55 +00:00
(require 'helm)
2015-03-24 21:58:59 +00:00
(require 'helm-config)
2015-04-06 21:35:55 +00:00
(require 'helm-grep)
2015-03-24 21:58:59 +00:00
(require 'helm-locate)
2015-04-06 21:35:55 +00:00
(require 'helm-misc)
(require 'projectile)
(require 'helm-projectile)
2015-03-24 21:58:59 +00:00
(setq helm-quick-update t)
(setq helm-bookmark-show-location t)
(setq helm-buffers-fuzzy-matching t)
2015-04-06 21:35:55 +00:00
;;; Save current position to mark ring
(add-hook 'helm-goto-line-before-hook 'helm-save-current-pos-to-mark-ring)
;; Better helm fonts
(set-face-attribute 'helm-selection nil :background "gold" :foreground "black")
2015-03-24 21:58:59 +00:00
2015-04-06 21:35:55 +00:00
;;; Keyboard mappings
2015-03-24 21:58:59 +00:00
(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)
2015-04-06 21:35:55 +00:00
(global-set-key (kbd "M-y") 'helm-show-kill-ring)
(global-set-key (kbd "C-x b") 'helm-mini)
(global-set-key (kbd "C-x C-f") 'helm-find-files)
(global-set-key (kbd "C-h SPC") 'helm-all-mark-rings)
(global-set-key (kbd "C-c h o") 'helm-occur)
2015-03-24 21:58:59 +00:00
2015-04-06 21:35:55 +00:00
(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)
2015-03-24 21:58:59 +00:00
;;; Evil helm
(define-key evil-normal-state-map (kbd "C-p") 'helm-mini)
2015-04-06 21:35:55 +00:00
(evil-leader/set-key "<SPC>" 'helm-M-x)
(define-key evil-normal-state-map (kbd ",f") 'helm-swoop)
2015-03-24 21:58:59 +00:00
(define-key evil-normal-state-map (kbd ",a") 'helm-ag)
2015-04-06 21:35:55 +00:00
(define-key evil-normal-state-map (kbd ",y") 'helm-show-kill-ring)
2015-03-24 21:58:59 +00:00
;;; Keyboard
(global-set-key (kbd "M-x") 'helm-M-x)
2015-04-06 21:35:55 +00:00
(define-key helm-map (kbd "C-w") 'backward-kill-word)
;; use helm to list eshell history
(add-hook 'eshell-mode-hook
#'(lambda ()
(define-key eshell-mode-map (kbd "M-l") 'helm-eshell-history)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; PACKAGE: helm-swoop ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Locate the helm-swoop folder to your path
(require 'helm-swoop)
;; Change the keybinds to whatever you like :)
(global-set-key (kbd "C-c h o") 'helm-swoop)
(global-set-key (kbd "C-c s") 'helm-multi-swoop-all)
;; When doing isearch, hand the word over to helm-swoop
(define-key isearch-mode-map (kbd "M-i") 'helm-swoop-from-isearch)
;; From helm-swoop to helm-multi-swoop-all
(define-key helm-swoop-map (kbd "M-i") 'helm-multi-swoop-all-from-helm-swoop)
;; Save buffer when helm-multi-swoop-edit complete
(setq helm-multi-swoop-edit-save t)
;; If this value is t, split window inside the current window
(setq helm-swoop-split-with-multiple-windows t)
;; Split direcion. 'split-window-vertically or 'split-window-horizontally
(setq helm-swoop-split-direction 'split-window-vertically)
;; If nil, you can slightly boost invoke speed in exchange for text color
(setq helm-swoop-speed-or-color t)
2015-03-24 21:58:59 +00:00
2015-04-06 21:35:55 +00:00
(helm-mode 1)
2015-03-24 21:58:59 +00:00
(provide 'config-helm)
2015-04-06 21:35:55 +00:00
;;; config-helm.el ends here