2017-06-09 13:36:58 +02:00
|
|
|
|
;;; completion/helm/config.el -*- lexical-binding: t; -*-
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
2017-02-21 03:46:22 -05:00
|
|
|
|
;; Warning: since I don't use helm, this may be out of date.
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
|
|
|
|
(defvar +helm-global-prompt "››› "
|
|
|
|
|
"The helm text prompt prefix string is globally replaced with this string.")
|
|
|
|
|
|
2017-02-21 03:46:22 -05:00
|
|
|
|
|
2017-02-13 21:12:02 -05:00
|
|
|
|
;;
|
|
|
|
|
;; Packages
|
|
|
|
|
;;
|
|
|
|
|
|
2017-06-09 13:36:58 +02:00
|
|
|
|
(def-package! helm
|
2017-02-13 21:12:02 -05:00
|
|
|
|
:init
|
|
|
|
|
(setq helm-quick-update t
|
|
|
|
|
;; Speedier without fuzzy matching
|
|
|
|
|
helm-mode-fuzzy-match nil
|
|
|
|
|
helm-buffers-fuzzy-matching nil
|
|
|
|
|
helm-apropos-fuzzy-match nil
|
|
|
|
|
helm-M-x-fuzzy-match nil
|
|
|
|
|
helm-recentf-fuzzy-match nil
|
|
|
|
|
helm-projectile-fuzzy-match nil
|
|
|
|
|
;; Display extraineous helm UI elements
|
|
|
|
|
helm-display-header-line nil
|
|
|
|
|
helm-ff-auto-update-initial-value nil
|
|
|
|
|
helm-find-files-doc-header nil
|
|
|
|
|
;; Don't override evil-ex's completion
|
|
|
|
|
helm-mode-handle-completion-in-region nil
|
|
|
|
|
helm-candidate-number-limit 50
|
|
|
|
|
;; Don't wrap item cycling
|
|
|
|
|
helm-move-to-line-cycle-in-source t)
|
|
|
|
|
|
|
|
|
|
:config
|
2017-06-09 13:36:58 +02:00
|
|
|
|
(load "helm-autoloads" nil t)
|
2017-06-12 00:20:30 +02:00
|
|
|
|
(add-hook 'doom-init-hook #'helm-mode)
|
2017-06-09 13:36:58 +02:00
|
|
|
|
|
2017-06-09 19:44:02 +02:00
|
|
|
|
(defvar helm-projectile-find-file-map (make-sparse-keymap))
|
|
|
|
|
(require 'helm-projectile)
|
|
|
|
|
(set-keymap-parent helm-projectile-find-file-map helm-map)
|
|
|
|
|
|
|
|
|
|
;; helm is too heavy for find-file-at-point
|
|
|
|
|
(after! helm-mode
|
|
|
|
|
(add-to-list 'helm-completing-read-handlers-alist '(find-file-at-point . nil)))
|
|
|
|
|
|
|
|
|
|
(set! :popup "\\` ?\\*[hH]elm.*?\\*\\'" :size 14 :regexp t)
|
|
|
|
|
(setq projectile-completion-system 'helm)
|
|
|
|
|
|
2017-06-09 13:36:58 +02:00
|
|
|
|
;;; Helm hacks
|
|
|
|
|
(defun +helm*replace-prompt (plist)
|
2017-06-09 19:44:02 +02:00
|
|
|
|
"Globally replace helm prompts with `+helm-global-prompt'."
|
2017-06-09 13:36:58 +02:00
|
|
|
|
(if (keywordp (car plist))
|
|
|
|
|
(plist-put plist :prompt +helm-global-prompt)
|
|
|
|
|
(setf (nth 2 plist) +helm-global-prompt)
|
|
|
|
|
plist))
|
|
|
|
|
(advice-add #'helm :filter-args #'+helm*replace-prompt)
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
2017-06-09 19:44:02 +02:00
|
|
|
|
(defun +helm*hide-header (&rest _)
|
|
|
|
|
"Hide header-line & mode-line in helm windows."
|
|
|
|
|
(setq mode-line-format nil))
|
2017-06-09 13:36:58 +02:00
|
|
|
|
(advice-add #'helm-display-mode-line :override #'+helm*hide-header)
|
|
|
|
|
|
2017-06-09 19:44:02 +02:00
|
|
|
|
(map! :map global-map
|
|
|
|
|
[remap apropos] #'helm-apropos
|
2017-06-09 13:36:58 +02:00
|
|
|
|
[remap find-file] #'helm-find-files
|
2017-10-23 19:59:48 +02:00
|
|
|
|
[remap recentf-open-files] #'helm-recentf
|
2017-06-09 19:44:02 +02:00
|
|
|
|
[remap projectile-switch-to-buffer] #'helm-projectile-switch-to-buffer
|
2017-06-09 13:36:58 +02:00
|
|
|
|
[remap projectile-recentf] #'helm-projectile-recentf
|
|
|
|
|
[remap projectile-find-file] #'helm-projectile-find-file
|
|
|
|
|
[remap imenu] #'helm-semantic-or-imenu
|
|
|
|
|
[remap bookmark-jump] #'helm-bookmarks
|
|
|
|
|
[remap noop-show-kill-ring] #'helm-show-kill-ring
|
|
|
|
|
[remap projectile-switch-project] #'helm-projectile-switch-project
|
|
|
|
|
[remap projectile-find-file] #'helm-projectile-find-file
|
|
|
|
|
[remap imenu-anywhere] #'helm-imenu-anywhere
|
2017-06-09 19:44:02 +02:00
|
|
|
|
[remap execute-extended-command] #'helm-M-x))
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
|
(def-package! helm-locate
|
2017-12-08 22:33:12 -05:00
|
|
|
|
:defer t
|
2017-06-09 13:36:58 +02:00
|
|
|
|
:init (defvar helm-generic-files-map (make-sparse-keymap))
|
2017-02-13 21:12:02 -05:00
|
|
|
|
:config (set-keymap-parent helm-generic-files-map helm-map))
|
|
|
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
|
(def-package! helm-bookmark
|
2017-12-08 22:33:12 -05:00
|
|
|
|
:commands helm-bookmark
|
2017-02-13 21:12:02 -05:00
|
|
|
|
:config (setq-default helm-bookmark-show-location t))
|
|
|
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
|
(def-package! helm-files
|
2017-12-08 22:33:12 -05:00
|
|
|
|
:defer t
|
2017-02-13 21:12:02 -05:00
|
|
|
|
:config
|
|
|
|
|
(setq helm-boring-file-regexp-list
|
|
|
|
|
(append (list "\\.projects$" "\\.DS_Store$")
|
2017-06-09 19:44:02 +02:00
|
|
|
|
helm-boring-file-regexp-list)))
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
|
(def-package! helm-ag
|
2017-12-08 22:33:12 -05:00
|
|
|
|
:defer t
|
2017-02-13 21:12:02 -05:00
|
|
|
|
:config
|
2017-06-09 19:44:02 +02:00
|
|
|
|
(map! :map helm-ag-edit-map
|
|
|
|
|
[remap doom/kill-this-buffer] #'helm-ag--edit-abort
|
|
|
|
|
[remap quit-window] #'helm-ag--edit-abort))
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
|
(def-package! helm-css-scss ; https://github.com/ShingoFukuyama/helm-css-scss
|
2017-02-13 21:12:02 -05:00
|
|
|
|
:commands (helm-css-scss
|
|
|
|
|
helm-css-scss-multi
|
|
|
|
|
helm-css-scss-insert-close-comment)
|
|
|
|
|
:config
|
2017-04-17 02:17:10 -04:00
|
|
|
|
(setq helm-css-scss-split-direction #'split-window-vertically
|
2017-02-13 21:12:02 -05:00
|
|
|
|
helm-css-scss-split-with-multiple-windows t))
|
|
|
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
|
(def-package! helm-swoop ; https://github.com/ShingoFukuyama/helm-swoop
|
2017-02-13 21:12:02 -05:00
|
|
|
|
:commands (helm-swoop helm-multi-swoop helm-multi-swoop-all)
|
|
|
|
|
:config
|
|
|
|
|
(setq helm-swoop-use-line-number-face t
|
|
|
|
|
helm-swoop-candidate-number-limit 200
|
|
|
|
|
helm-swoop-speed-or-color t
|
|
|
|
|
helm-swoop-pre-input-function (lambda () "")))
|
|
|
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
|
(def-package! helm-describe-modes :commands helm-describe-modes)
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|