From: Don Armstrong Date: Tue, 19 Dec 2017 01:05:14 +0000 (-0800) Subject: add more helm modes X-Git-Url: https://git.donarmstrong.com/?p=lib.git;a=commitdiff_plain;h=845e4083176a7234403d86ec371a922b24689aee add more helm modes --- diff --git a/emacs_el/configuration/don-configuration.org b/emacs_el/configuration/don-configuration.org index ec00578..0291bd4 100644 --- a/emacs_el/configuration/don-configuration.org +++ b/emacs_el/configuration/don-configuration.org @@ -302,30 +302,6 @@ value, scrolling continues until there is no more output. ) ) #+END_SRC -** Helm Flx - -[[https://github.com/PythonNut/helm-flx][helm-flx]] implements intelligent helm fuzzy sorting, provided by [[https://github.com/lewang/flx][flx]]. - -#+BEGIN_SRC emacs-lisp -(use-package helm-flx - :ensure t - :config (progn - ;; these are helm configs, but they kind of fit here nicely - (setq helm-M-x-fuzzy-match t - helm-bookmark-show-location t - helm-buffers-fuzzy-matching t - helm-completion-in-region-fuzzy-match t - helm-file-cache-fuzzy-match t - helm-imenu-fuzzy-match t - helm-mode-fuzzy-match t - helm-locate-fuzzy-match nil - helm-quick-update t - helm-recentf-fuzzy-match nil - helm-semantic-fuzzy-match t) - (helm-flx-mode +1))) -#+END_SRC - - ** Tinyprocmail #+BEGIN_SRC emacs-lisp @@ -408,6 +384,119 @@ value, scrolling continues until there is no more output. (add-hook 'kill-emacs-hook #'(lambda () (and (file-exists-p "$TMP") (delete-file "$TMP")))) ) #+END_SRC +*** Helm Flx + + [[https://github.com/PythonNut/helm-flx][helm-flx]] implements intelligent helm fuzzy sorting, provided by [[https://github.com/lewang/flx][flx]]. + + #+BEGIN_SRC emacs-lisp + (use-package helm-flx + :ensure t + :config (progn + ;; these are helm configs, but they kind of fit here nicely + (setq helm-M-x-fuzzy-match t + helm-bookmark-show-location t + helm-buffers-fuzzy-matching t + helm-completion-in-region-fuzzy-match t + helm-file-cache-fuzzy-match t + helm-imenu-fuzzy-match t + helm-mode-fuzzy-match t + helm-locate-fuzzy-match nil + helm-quick-update t + helm-recentf-fuzzy-match nil + helm-semantic-fuzzy-match t) + (helm-flx-mode +1))) + #+END_SRC +*** Helm Swoop +#+BEGIN_SRC emacs-lisp + + ;;; stolen from https://github.com/malb/emacs.d/blob/master/malb.org + (defun malb/helm-swoop-pr2e-fill () + (thing-at-point 'symbol)) + (setq malb/helm-swoop-ignore-major-mode '(dired-mode + paradox-menu-mode doc-view-mode pdf-view-mode + mu4e-headers-mode org-mode markdown-mode latex-mode + ein:notebook-multilang-mode)) + + (defun malb/swoop-or-search () + (interactive) + (if (or (> (buffer-size) 1048576) ;; helm-swoop can be slow on big buffers + (memq major-mode malb/helm-swoop-ignore-major-mode)) + (isearch-forward) + (helm-swoop))) + + (use-package helm-swoop + :ensure t + :bind (("C-c o" . helm-multi-swoop-org) + ("C-s" . malb/swoop-or-search) + ("C-M-s" . helm-multi-swoop-all)) + :config (progn + + (setq helm-swoop-pre-input-function #'malb/helm-swoop-pre-fill + helm-swoop-split-with-multiple-windows nil + helm-swoop-split-direction #'split-window-horizontally + helm-swoop-split-window-function 'helm-default-display-buffer + helm-swoop-speed-or-color t) + + ;; https://emacs.stackexchange.com/questions/28790/helm-swoop-how-to-make-it-behave-more-like-isearch + (defun malb/helm-swoop-C-s () + (interactive) + (if (boundp 'helm-swoop-pattern) + (if (equal helm-swoop-pattern "") + (previous-history-element 1) + (helm-next-line)) + (helm-next-line))) + + (bind-key "C-S-s" #'helm-swoop-from-isearch isearch-mode-map) + (bind-key "C-S-s" #'helm-multi-swoop-all-from-helm-swoop helm-swoop-map) + (bind-key "C-r" #'helm-previous-line helm-swoop-map) + (bind-key "C-s" #'malb/helm-swoop-C-s helm-swoop-map) + (bind-key "C-r" #'helm-previous-line helm-multi-swoop-map) + (bind-key "C-s" #'malb/helm-swoop-C-s helm-multi-swoop-map)) + ) + +#+END_SRC +*** Helm Ag +#+BEGIN_SRC emacs-lisp +(use-package helm-ag + :ensure t + :config (setq helm-ag-base-command "ag --nocolor --nogroup" + helm-ag-command-option "--all-text" + helm-ag-insert-at-point 'symbol + helm-ag-fuzzy-match t + helm-ag-use-temp-buffer t + helm-ag-use-grep-ignore-list t + helm-ag-use-agignore t)) +#+END_SRC +*** Helm Descbinds +#+BEGIN_SRC emacs-lisp + (use-package helm-descbinds + :ensure t + :bind ("C-h b" . helm-descbinds) + :init (fset 'describe-bindings 'helm-descbinds)) +#+END_SRC + +*** Helm YaSnippet +#+BEGIN_SRC emacs-lisp + (use-package helm-c-yasnippet + :ensure t + :bind ("C-c h y" . helm-yas-complete) + :config (progn + (setq helm-yas-space-match-any-greedy t))) +#+END_SRC +*** Helm Org Rifle +#+BEGIN_SRC emacs-lisp + (use-package helm-org-rifle + :ensure t + :config (progn + (defun malb/helm-org-rifle-agenda-files (arg) + (interactive "p") + (let ((current-prefix-arg nil)) + (cond + ((equal arg 4) (call-interactively #'helm-org-rifle-agenda-files nil)) + ((equal arg 16) (helm-org-rifle-occur-agenda-files)) + (t (helm-org-agenda-files-headings))))))) +#+END_SRC + ** Hydra #+BEGIN_SRC emacs-lisp :tangle don-configuration.el (require 'don-hydra)