completion/helm: fix and update

This commit is contained in:
Henrik Lissner 2018-03-02 23:11:49 -05:00
parent c6352f055d
commit 55fd9e2b17
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -10,7 +10,15 @@
;; Packages ;; Packages
;; ;;
(def-package! helm-mode
:hook (doom-init . helm-mode)
:config
;; helm is too heavy for find-file-at-point
(add-to-list 'helm-completing-read-handlers-alist '(find-file-at-point . nil)))
(def-package! helm (def-package! helm
:after helm-mode
:init :init
(setq helm-quick-update t (setq helm-quick-update t
;; Speedier without fuzzy matching ;; Speedier without fuzzy matching
@ -31,18 +39,12 @@
helm-move-to-line-cycle-in-source t) helm-move-to-line-cycle-in-source t)
:config :config
(add-hook 'doom-init-hook #'helm-mode) (setq projectile-completion-system 'helm)
(defvar helm-projectile-find-file-map (make-sparse-keymap)) (defvar helm-projectile-find-file-map (make-sparse-keymap))
(require 'helm-projectile) (require 'helm-projectile)
(set-keymap-parent helm-projectile-find-file-map helm-map) (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)))
(setq projectile-completion-system 'helm)
;;; Helm hacks ;;; Helm hacks
(defun +helm*replace-prompt (plist) (defun +helm*replace-prompt (plist)
"Globally replace helm prompts with `+helm-global-prompt'." "Globally replace helm prompts with `+helm-global-prompt'."
@ -57,6 +59,17 @@
(setq mode-line-format nil)) (setq mode-line-format nil))
(advice-add #'helm-display-mode-line :override #'+helm*hide-header) (advice-add #'helm-display-mode-line :override #'+helm*hide-header)
(defun +helm*hide-minibuffer-maybe ()
"Hide minibuffer in Helm session if we use the header line as input field."
(when (with-helm-buffer helm-echo-input-in-header-line)
(let ((ov (make-overlay (point-min) (point-max) nil nil t)))
(overlay-put ov 'window (selected-window))
(overlay-put ov 'face
(let ((bg-color (face-background 'default nil)))
`(:background ,bg-color :foreground ,bg-color)))
(setq-local cursor-type nil))))
(add-hook 'helm-minibuffer-set-up-hook #'+helm*hide-minibuffer-maybe)
(map! :map global-map (map! :map global-map
[remap apropos] #'helm-apropos [remap apropos] #'helm-apropos
[remap find-file] #'helm-find-files [remap find-file] #'helm-find-files
@ -107,6 +120,10 @@
helm-css-scss-split-with-multiple-windows t)) helm-css-scss-split-with-multiple-windows t))
(def-package! helm-for-files
:commands (helm-for-files helm-recentf helm-multi-files))
(def-package! helm-swoop ; https://github.com/ShingoFukuyama/helm-swoop (def-package! helm-swoop ; https://github.com/ShingoFukuyama/helm-swoop
:commands (helm-swoop helm-multi-swoop helm-multi-swoop-all) :commands (helm-swoop helm-multi-swoop helm-multi-swoop-all)
:config :config