From 9c5426c381537b0cf4c57855ab4aae2cb9043f6f Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 30 Jun 2016 13:37:25 +0200 Subject: emacs: show the Helm pattern on the header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This requires some magic that it's been provided in a Reddit thread :) Signed-off-by: Miquel Sabaté Solà --- emacs/init.el | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'emacs/init.el') diff --git a/emacs/init.el b/emacs/init.el index 0167ce0..7400394 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -209,7 +209,24 @@ (use-package helm :ensure t :config - (setq projectile-completion-system 'helm)) + (setq projectile-completion-system 'helm) + + ; Allow the search pattern to be on the header. Taken from this Reddit thread: + ; https://www.reddit.com/r/emacs/comments/3asbyn/new_and_very_useful_helm_feature_enter_search/ + (setq helm-echo-input-in-header-line t) + + (defun helm-hide-minibuffer-maybe () + "Hide the minibuffer if we are in a Helm session" + + (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) + (setq helm-split-window-in-side-p t)) (use-package helm-projectile :ensure t -- cgit v1.2.3