2016-10-14 14:03:30 +02:00
|
|
|
;; Helm
|
|
|
|
|
2016-06-10 13:53:40 +02:00
|
|
|
(when (require 'helm-descbinds nil t)
|
|
|
|
(helm-descbinds-mode))
|
|
|
|
|
2016-09-23 15:24:15 +02:00
|
|
|
(require 'helm-ls-git nil t)
|
2016-06-10 13:53:40 +02:00
|
|
|
(helm-mode 1)
|
|
|
|
; (helm-autoresize-mode 1)
|
|
|
|
(setq helm-follow-mode-persistent t)
|
|
|
|
(add-to-list 'helm-sources-using-default-as-input 'helm-source-man-pages)
|
2016-07-21 13:37:46 +02:00
|
|
|
;; (setq helm-split-window-default-side 'right)
|
|
|
|
(setq helm-reuse-last-window-split-state t)
|
2016-06-10 13:53:40 +02:00
|
|
|
|
|
|
|
(setq helm-apropos-fuzzy-match t)
|
|
|
|
(setq helm-buffers-fuzzy-matching t)
|
|
|
|
(setq helm-imenu-fuzzy-match t)
|
|
|
|
(setq helm-M-x-fuzzy-match t)
|
|
|
|
|
2016-09-23 15:24:15 +02:00
|
|
|
;; Do not exclude any files from 'git grep'.
|
|
|
|
(setq helm-grep-git-grep-command "git --no-pager grep -n%cH --color=always --full-name -e %p -- %f")
|
|
|
|
|
|
|
|
;; Use `pt' instead of `ag'.
|
2016-10-13 05:29:28 +02:00
|
|
|
(setq helm-grep-ag-command "pt -e -S --hidden --color --nogroup %s %s %s")
|
2016-09-23 15:24:15 +02:00
|
|
|
|
|
|
|
(defun helm-grep-git-or-ag (arg)
|
2016-10-12 05:43:03 +02:00
|
|
|
"Run `helm-grep-do-git-grep' if possible; fallback to `helm-do-grep-ag' otherwise.
|
|
|
|
Requires `call-process-to-string' from `functions'."
|
2016-09-23 15:24:15 +02:00
|
|
|
(interactive "P")
|
|
|
|
(require 'vc)
|
2016-10-12 05:43:03 +02:00
|
|
|
(require 'functions)
|
|
|
|
(if (and (vc-find-root default-directory ".git")
|
|
|
|
(or arg (split-string (call-process-to-string "git" "ls-files" "-z") "\0" t)))
|
2016-09-23 15:24:15 +02:00
|
|
|
(helm-grep-do-git-grep arg)
|
|
|
|
(helm-do-grep-ag arg)))
|
|
|
|
|
2016-10-05 06:56:16 +02:00
|
|
|
(defun helm-mark-or-exchange-rect ()
|
|
|
|
"Run `helm-all-mark-rings' or `rectangle-exchange-point-and-mark' if in rectangle-mark-mode."
|
|
|
|
(interactive)
|
|
|
|
(if rectangle-mark-mode
|
|
|
|
(rectangle-exchange-point-and-mark)
|
|
|
|
(helm-all-mark-rings)))
|
|
|
|
|
2016-06-10 13:53:40 +02:00
|
|
|
(define-key mickey-minor-mode-map (kbd "M-x") 'helm-M-x)
|
2016-06-12 22:50:34 +02:00
|
|
|
(define-key mickey-minor-mode-map (kbd "C-x M-f") 'helm-semantic-or-imenu)
|
2016-06-10 13:53:40 +02:00
|
|
|
(define-key mickey-minor-mode-map (kbd "C-x C-/") 'helm-find)
|
|
|
|
(when (require 'helm-fuzzy-find nil t)
|
|
|
|
(define-key mickey-minor-mode-map (kbd "C-c C-/") 'helm-fuzzy-find))
|
|
|
|
(define-key mickey-minor-mode-map (kbd "C-x C-f") 'helm-find-files)
|
|
|
|
(define-key mickey-minor-mode-map (kbd "C-x C-d") 'helm-browse-project)
|
|
|
|
(define-key mickey-minor-mode-map (kbd "C-x b") 'helm-buffers-list)
|
|
|
|
(define-key mickey-minor-mode-map (kbd "C-x C-b") 'helm-mini)
|
|
|
|
(define-key mickey-minor-mode-map (kbd "M-y") 'helm-show-kill-ring)
|
2016-10-05 06:56:16 +02:00
|
|
|
(define-key mickey-minor-mode-map (kbd "C-x C-x") 'helm-mark-or-exchange-rect)
|
2016-06-10 13:53:40 +02:00
|
|
|
(define-key mickey-minor-mode-map (kbd "C-x x") 'helm-mark-ring)
|
|
|
|
(define-key mickey-minor-mode-map (kbd "M-s o") 'helm-occur)
|
|
|
|
(define-key mickey-minor-mode-map (kbd "C-h a") 'helm-apropos)
|
|
|
|
(define-key mickey-minor-mode-map (kbd "C-M-%") 'helm-regexp)
|
2016-10-08 04:21:44 +02:00
|
|
|
(define-key mickey-minor-mode-map (kbd "C-x M-g") 'helm-grep-git-or-ag)
|
|
|
|
(define-key mickey-minor-mode-map (kbd "C-x M-G") 'helm-do-grep-ag)
|
2016-09-23 15:25:19 +02:00
|
|
|
(define-key mickey-minor-mode-map (kbd "C-x r b") 'helm-filtered-bookmarks)
|
2016-06-10 13:53:40 +02:00
|
|
|
|
2016-06-11 08:10:32 +02:00
|
|
|
(set-face-background 'helm-source-header "white")
|
|
|
|
(set-face-foreground 'helm-source-header "black")
|
2016-06-10 13:53:40 +02:00
|
|
|
(set-face-background 'helm-selection "#4f4f4f")
|
|
|
|
(set-face-background 'helm-visible-mark "#2f2f2f")
|
|
|
|
(set-face-foreground 'helm-visible-mark nil)
|
2016-06-10 14:18:22 +02:00
|
|
|
(set-face-foreground 'helm-match "red")
|
2016-06-12 22:50:34 +02:00
|
|
|
(set-face-attribute 'helm-buffer-file nil :background 'unspecified :foreground "white" :weight 'normal)
|
2016-06-10 13:53:40 +02:00
|
|
|
(set-face-attribute 'helm-buffer-directory nil :background 'unspecified :foreground "#1e90ff" :weight 'bold)
|
|
|
|
(set-face-attribute 'helm-ff-directory nil :background 'unspecified :foreground 'unspecified :weight 'unspecified :inherit 'helm-buffer-directory)
|
|
|
|
(set-face-attribute 'helm-ff-file nil :background 'unspecified :foreground 'unspecified :weight 'unspecified :inherit 'helm-buffer-file)
|
|
|
|
;; Helm color for unsaved buffers? Dim special *buffers*?
|
|
|
|
|
|
|
|
(provide 'tool-helm)
|