From 6384bbeb7a5aa94dc0429fd22792e7baabc6158a Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Tue, 14 Feb 2017 08:33:02 -0700 Subject: [PATCH] Move helm configuration around --- eos-helm.org | 140 +++++++++++++++++++++++++-------------------------- 1 file changed, 69 insertions(+), 71 deletions(-) diff --git a/eos-helm.org b/eos-helm.org index 8b74936..ce408bc 100644 --- a/eos-helm.org +++ b/eos-helm.org @@ -67,8 +67,8 @@ bindings I use more frequently: | C-x C-i | helm semantic or imenu (depending on the mode) | #+BEGIN_SRC emacs-lisp -(use-package helm-config - :ensure helm +(use-package helm + :ensure t :demand t ;; demand it be loaded! :diminish helm-mode :bind @@ -86,6 +86,64 @@ bindings I use more frequently: ("C-x C-r" . helm-mini) ("C-x b" . helm-mini) ("C-h t" . helm-world-time)) + :init + (setq helm-grep-default-command + "grep -a -d skip %e -n%cH -e %p %f" + ;; may be overridden if 'ggrep' is in path (see below) + helm-grep-default-recurse-command + "grep -a -d recurse %e -n%cH -e %p %f" + ;; use CURL, not url-retrieve-synchronously + helm-net-prefer-curl t + ;; be idle for this many seconds, before updating in delayed sources. + helm-input-idle-delay 0.05 + ;; wider buffer name in helm-buffers-list + helm-buffer-max-length 28 ;; default is 20 + ;; instead of "..." use a smaller unicode ellipsis + helm-buffers-end-truncated-string "…" + ;; open helm buffer in another window + ;;helm-split-window-default-side 'other + ;; set to nil and use to toggle it in helm-find-files + helm-ff-auto-update-initial-value nil + ;; if I change the resplit state, re-use my settings + ;; helm-reuse-last-window-split-state t + ;; don't delete windows to always have 2 + helm-always-two-windows nil + ;; open helm buffer inside current window, don't occupy whole other window + helm-split-window-in-side-p t + ;; fit buffer to width automatically + ;; fit-window-to-buffer-horizontally 1 + ;; don't check if the file exists on remote files + helm-buffer-skip-remote-checking t + ;; limit the number of displayed canidates + helm-candidate-number-limit 150 + ;; don't use recentf stuff in helm-ff, I use C-x C-r for this + helm-ff-file-name-history-use-recentf nil + ;; move to end or beginning of source when reaching top or bottom + ;; of source + helm-move-to-line-cycle-in-source t + ;; don't display the header line + helm-display-header-line nil + ;; be semi-verbose for helm tramp messages + helm-tramp-verbose 3 + ;; fuzzy matching + helm-recentf-fuzzy-match t + helm-locate-fuzzy-match nil ;; locate fuzzy is worthless + helm-M-x-fuzzy-match t + helm-buffers-fuzzy-matching t + helm-semantic-fuzzy-match t + helm-gtags-fuzzy-match t + helm-imenu-fuzzy-match t + helm-apropos-fuzzy-match nil + helm-lisp-fuzzy-completion nil + helm-completion-in-region-fuzzy-match nil + helm-autoresize-min-height 6 + helm-autoresize-max-height 25 + ;; Here are the things helm-mini shows, I add `helm-source-bookmarks' + ;; here to the regular default list + helm-mini-default-sources '(helm-source-buffers-list + helm-source-recentf + helm-source-bookmarks + helm-source-buffer-not-found)) :config (use-package helm-files :config (setq helm-ff-file-compressed-list '("gz" "bz2" "zip" "tgz" "xz" "txz"))) @@ -122,6 +180,7 @@ bindings I use more frequently: :init (use-package bookmark+ :ensure t)) (use-package helm-projectile :ensure t + :demand t ;; demand it be loaded! :bind (:map projectile-command-map ("b" . helm-projectile-switch-to-buffer) ("d" . helm-projectile-find-dir) @@ -148,74 +207,16 @@ bindings I use more frequently: ;; Shows helm input in the header instead of the footer (setq helm-echo-input-in-header-line t) (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)))) + "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) - (setq helm-grep-default-command - "grep -a -d skip %e -n%cH -e %p %f" - ;; may be overridden if 'ggrep' is in path (see below) - helm-grep-default-recurse-command - "grep -a -d recurse %e -n%cH -e %p %f" - ;; use CURL, not url-retrieve-synchronously - helm-net-prefer-curl t - ;; be idle for this many seconds, before updating in delayed sources. - helm-input-idle-delay 0.05 - ;; wider buffer name in helm-buffers-list - helm-buffer-max-length 28 ;; default is 20 - ;; instead of "..." use a smaller unicode ellipsis - helm-buffers-end-truncated-string "…" - ;; open helm buffer in another window - ;;helm-split-window-default-side 'other - ;; set to nil and use to toggle it in helm-find-files - helm-ff-auto-update-initial-value nil - ;; if I change the resplit state, re-use my settings - ;; helm-reuse-last-window-split-state t - ;; don't delete windows to always have 2 - helm-always-two-windows nil - ;; open helm buffer inside current window, don't occupy whole other window - helm-split-window-in-side-p t - ;; fit buffer to width automatically - ;; fit-window-to-buffer-horizontally 1 - ;; don't check if the file exists on remote files - helm-buffer-skip-remote-checking t - ;; limit the number of displayed canidates - helm-candidate-number-limit 150 - ;; don't use recentf stuff in helm-ff, I use C-x C-r for this - helm-ff-file-name-history-use-recentf nil - ;; move to end or beginning of source when reaching top or bottom - ;; of source - helm-move-to-line-cycle-in-source t - ;; don't display the header line - helm-display-header-line nil - ;; be semi-verbose for helm tramp messages - helm-tramp-verbose 3 - ;; fuzzy matching - helm-recentf-fuzzy-match t - helm-locate-fuzzy-match nil ;; locate fuzzy is worthless - helm-M-x-fuzzy-match t - helm-buffers-fuzzy-matching t - helm-semantic-fuzzy-match t - helm-gtags-fuzzy-match t - helm-imenu-fuzzy-match t - helm-apropos-fuzzy-match nil - helm-lisp-fuzzy-completion nil - helm-completion-in-region-fuzzy-match nil - helm-autoresize-min-height 6 - helm-autoresize-max-height 25 - ;; Here are the things helm-mini shows, I add `helm-source-bookmarks' - ;; here to the regular default list - helm-mini-default-sources '(helm-source-buffers-list - helm-source-recentf - helm-source-bookmarks - helm-source-buffer-not-found)) - ;; Files that helm should know how to open (setq helm-external-programs-associations '(("avi" . "vlc") @@ -248,9 +249,6 @@ bindings I use more frequently: (define-key helm-map (kbd "C-M-p") 'helm-previous-source) (define-key helm-map (kbd "M-N") 'helm-next-source) (define-key helm-map (kbd "M-P") 'helm-previous-source) - ;; The normal binding is C-c h M-g s which is insane - (global-set-key (kbd "C-c h g") 'helm-do-grep) - (global-set-key (kbd "C-c h a") 'helm-do-ag) (when (executable-find "curl") (setq helm-google-suggest-use-curl-p t))