2016-05-16 01:58:41 +00:00
|
|
|
;;; packages.el --- Helm Layer packages File
|
2016-01-04 19:20:54 +00:00
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2016-01-04 19:20:54 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2016-01-04 19:20:54 +00:00
|
|
|
|
2016-05-16 02:24:27 +00:00
|
|
|
(setq helm-packages
|
2016-06-10 02:50:24 +00:00
|
|
|
'(
|
|
|
|
ace-jump-helm-line
|
|
|
|
auto-highlight-symbol
|
2016-04-06 09:28:06 +00:00
|
|
|
bookmark
|
2016-01-04 19:20:54 +00:00
|
|
|
helm
|
|
|
|
helm-ag
|
|
|
|
helm-descbinds
|
|
|
|
helm-flx
|
2019-10-27 21:07:20 +00:00
|
|
|
(helm-ls-git :require git)
|
2016-01-04 19:20:54 +00:00
|
|
|
helm-make
|
|
|
|
helm-mode-manager
|
2020-09-07 02:31:18 +00:00
|
|
|
helm-org
|
2016-01-04 19:20:54 +00:00
|
|
|
helm-projectile
|
|
|
|
helm-swoop
|
|
|
|
helm-themes
|
2016-06-10 02:50:24 +00:00
|
|
|
(helm-spacemacs-help :location local)
|
2017-01-16 02:53:43 +00:00
|
|
|
(helm-spacemacs-faq :location local)
|
2018-02-19 03:48:12 +00:00
|
|
|
helm-xref
|
2016-08-26 00:42:01 +00:00
|
|
|
imenu
|
2016-10-23 14:35:06 +00:00
|
|
|
persp-mode
|
2016-08-02 16:18:28 +00:00
|
|
|
popwin
|
2016-06-17 18:23:48 +00:00
|
|
|
projectile
|
2016-06-10 02:50:24 +00:00
|
|
|
))
|
2016-01-04 19:20:54 +00:00
|
|
|
|
|
|
|
;; Initialization of packages
|
|
|
|
|
2016-05-16 02:24:27 +00:00
|
|
|
(defun helm/init-ace-jump-helm-line ()
|
2016-01-04 19:20:54 +00:00
|
|
|
(use-package ace-jump-helm-line
|
2018-03-31 05:05:06 +00:00
|
|
|
:defer (spacemacs/defer)
|
2016-01-04 19:20:54 +00:00
|
|
|
:init
|
|
|
|
(with-eval-after-load 'helm
|
|
|
|
(define-key helm-map (kbd "C-q") 'ace-jump-helm-line))))
|
|
|
|
|
2016-06-10 02:50:24 +00:00
|
|
|
(defun helm/pre-init-auto-highlight-symbol ()
|
|
|
|
(spacemacs|use-package-add-hook auto-highlight-symbol
|
|
|
|
:post-init
|
|
|
|
;; add some functions to ahs transient states
|
|
|
|
(setq spacemacs--symbol-highlight-transient-state-doc
|
2017-08-31 19:30:23 +00:00
|
|
|
(concat
|
|
|
|
spacemacs--symbol-highlight-transient-state-doc
|
|
|
|
" Search: [_s_] swoop [_b_] buffers [_f_] files [_/_] project"))
|
2017-05-23 14:04:40 +00:00
|
|
|
(spacemacs/transient-state-register-add-bindings 'symbol-highlight
|
2017-08-31 19:30:23 +00:00
|
|
|
'(("s" spacemacs/helm-swoop-region-or-symbol :exit t)
|
2017-02-21 10:07:23 +00:00
|
|
|
("b" spacemacs/helm-buffers-smart-do-search-region-or-symbol :exit t)
|
|
|
|
("f" spacemacs/helm-files-smart-do-search-region-or-symbol :exit t)
|
2017-08-31 19:30:23 +00:00
|
|
|
("/" spacemacs/helm-project-smart-do-search-region-or-symbol :exit t)))))
|
2016-06-10 02:50:24 +00:00
|
|
|
|
2016-05-16 02:24:27 +00:00
|
|
|
(defun helm/post-init-bookmark ()
|
2016-04-06 09:28:06 +00:00
|
|
|
(spacemacs/set-leader-keys "fb" 'helm-filtered-bookmarks))
|
|
|
|
|
2016-05-16 02:24:27 +00:00
|
|
|
(defun helm/init-helm ()
|
2016-01-04 19:20:54 +00:00
|
|
|
(use-package helm
|
2018-06-14 06:03:48 +00:00
|
|
|
:defer (spacemacs/defer)
|
2016-01-04 19:20:54 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2020-07-14 11:24:00 +00:00
|
|
|
(spacemacs|diminish helm-ff-cache-mode)
|
2019-01-27 11:38:42 +00:00
|
|
|
(spacemacs|add-transient-hook completing-read
|
|
|
|
(lambda (&rest _args) (require 'helm))
|
|
|
|
lazy-load-helm-for-completing-read)
|
2019-06-02 12:51:28 +00:00
|
|
|
(spacemacs|add-transient-hook completion-at-point
|
|
|
|
(lambda (&rest _args) (require 'helm))
|
|
|
|
lazy-load-helm-for-completion-at-point)
|
|
|
|
(spacemacs|add-transient-hook read-file-name
|
|
|
|
(lambda (&rest _args) (require 'helm))
|
|
|
|
lazy-load-helm-for-read-file-name)
|
2016-07-18 11:37:40 +00:00
|
|
|
(add-hook 'helm-cleanup-hook #'spacemacs//helm-cleanup)
|
2016-05-16 01:58:41 +00:00
|
|
|
;; key bindings
|
2016-01-04 19:20:54 +00:00
|
|
|
;; Use helm to provide :ls, unless ibuffer is used
|
2017-07-02 13:48:06 +00:00
|
|
|
(unless (configuration-layer/package-used-p 'ibuffer)
|
2016-01-04 19:20:54 +00:00
|
|
|
(evil-ex-define-cmd "buffers" 'helm-buffers-list))
|
2018-06-12 17:29:25 +00:00
|
|
|
;; use helm by default for M-x, C-x C-f, and C-x b
|
|
|
|
(unless (configuration-layer/layer-usedp 'smex)
|
2020-05-11 10:36:56 +00:00
|
|
|
(global-set-key (kbd "M-x") 'spacemacs/helm-M-x-fuzzy-matching))
|
2016-03-11 04:10:02 +00:00
|
|
|
(global-set-key (kbd "C-x C-f") 'spacemacs/helm-find-files)
|
|
|
|
(global-set-key (kbd "C-x b") 'helm-buffers-list)
|
2021-01-29 10:11:44 +00:00
|
|
|
;; use helm to switch last(/previous) visited buffers with C(-S)-tab
|
|
|
|
(evil-global-set-key 'motion (kbd "<C-tab>") 'helm-buffers-list)
|
|
|
|
(evil-global-set-key 'motion (kbd "<C-iso-lefttab>") 'helm-buffers-list)
|
2016-05-16 01:58:41 +00:00
|
|
|
;; use helm everywhere
|
2018-06-14 06:03:48 +00:00
|
|
|
(spacemacs||set-helm-key "<f1>" helm-apropos)
|
|
|
|
(spacemacs||set-helm-key "a'" helm-available-repls)
|
|
|
|
(spacemacs||set-helm-key "bb" helm-mini)
|
2018-11-06 12:10:42 +00:00
|
|
|
(spacemacs||set-helm-key "bU" spacemacs/helm-buffers-list-unfiltered)
|
2018-06-14 06:03:48 +00:00
|
|
|
(spacemacs||set-helm-key "Cl" helm-colors)
|
|
|
|
(spacemacs||set-helm-key "ff" spacemacs/helm-find-files)
|
2019-04-24 14:13:30 +00:00
|
|
|
(spacemacs||set-helm-key "fF" helm-find-files)
|
2018-06-14 06:03:48 +00:00
|
|
|
(spacemacs||set-helm-key "fL" helm-locate)
|
|
|
|
(spacemacs||set-helm-key "fr" helm-recentf)
|
2019-02-12 07:22:01 +00:00
|
|
|
(spacemacs||set-helm-key "hda" helm-apropos)
|
2018-06-14 06:03:48 +00:00
|
|
|
(spacemacs||set-helm-key "hdF" spacemacs/helm-faces)
|
|
|
|
(spacemacs||set-helm-key "hi" helm-info-at-point)
|
|
|
|
(spacemacs||set-helm-key "hm" helm-man-woman)
|
|
|
|
(spacemacs||set-helm-key "iu" helm-ucs)
|
|
|
|
(spacemacs||set-helm-key "jI" helm-imenu-in-all-buffers)
|
|
|
|
(spacemacs||set-helm-key "rm" helm-all-mark-rings)
|
|
|
|
(spacemacs||set-helm-key "rl" helm-resume)
|
|
|
|
(spacemacs||set-helm-key "rr" helm-register)
|
|
|
|
(spacemacs||set-helm-key "rs" spacemacs/resume-last-search-buffer)
|
|
|
|
(spacemacs||set-helm-key "ry" helm-show-kill-ring)
|
|
|
|
(spacemacs||set-helm-key "sl" spacemacs/resume-last-search-buffer)
|
|
|
|
(spacemacs||set-helm-key "sj" spacemacs/helm-jump-in-buffer)
|
2016-01-04 19:20:54 +00:00
|
|
|
;; search with grep
|
2018-06-14 06:03:48 +00:00
|
|
|
(spacemacs||set-helm-key "sgb" spacemacs/helm-buffers-do-grep)
|
|
|
|
(spacemacs||set-helm-key "sgB" spacemacs/helm-buffers-do-grep-region-or-symbol)
|
|
|
|
(spacemacs||set-helm-key "sgf" spacemacs/helm-files-do-grep)
|
|
|
|
(spacemacs||set-helm-key "sgF" spacemacs/helm-files-do-grep-region-or-symbol)
|
|
|
|
(spacemacs||set-helm-key "sgg" spacemacs/helm-file-do-grep)
|
|
|
|
(spacemacs||set-helm-key "sgG" spacemacs/helm-file-do-grep-region-or-symbol)
|
2016-05-16 01:58:41 +00:00
|
|
|
;; various key bindings
|
2018-06-14 06:03:48 +00:00
|
|
|
(spacemacs||set-helm-key "fel" helm-locate-library)
|
2016-05-16 01:58:41 +00:00
|
|
|
(spacemacs||set-helm-key "hdm" describe-mode)
|
2021-04-13 12:10:40 +00:00
|
|
|
(spacemacs||set-helm-key "hdx" spacemacs/describe-ex-command)
|
2016-05-16 01:58:41 +00:00
|
|
|
(spacemacs||set-helm-key "swg" helm-google-suggest)
|
|
|
|
(with-eval-after-load 'helm-files
|
|
|
|
(define-key helm-find-files-map
|
2019-12-19 08:12:36 +00:00
|
|
|
(kbd "C-c C-e") 'spacemacs/helm-find-files-edit)
|
|
|
|
(defun spacemacs//add-action-helm-find-files-edit ()
|
|
|
|
(helm-add-action-to-source
|
2020-05-11 10:36:56 +00:00
|
|
|
"Edit files in dired `C-c C-e'" 'spacemacs//helm-find-files-edit
|
|
|
|
helm-source-find-files))
|
2019-12-19 08:12:36 +00:00
|
|
|
(add-hook 'helm-find-files-before-init-hook
|
|
|
|
'spacemacs//add-action-helm-find-files-edit))
|
2016-05-16 01:58:41 +00:00
|
|
|
;; Add minibuffer history with `helm-minibuffer-history'
|
|
|
|
(define-key minibuffer-local-map (kbd "C-c C-l") 'helm-minibuffer-history)
|
2018-06-14 06:03:48 +00:00
|
|
|
;; Delay this key bindings to override the defaults
|
2016-01-04 19:20:54 +00:00
|
|
|
(add-hook 'emacs-startup-hook
|
|
|
|
(lambda ()
|
2018-06-14 06:03:48 +00:00
|
|
|
(spacemacs||set-helm-key "hdb" describe-bindings)
|
|
|
|
(spacemacs||set-helm-key "hdc" describe-char)
|
|
|
|
(spacemacs||set-helm-key "hdf" describe-function)
|
|
|
|
(spacemacs||set-helm-key "hdk" describe-key)
|
|
|
|
(spacemacs||set-helm-key "hdl" spacemacs/describe-last-keys)
|
|
|
|
(spacemacs||set-helm-key "hdp" describe-package)
|
|
|
|
(spacemacs||set-helm-key "hdP" configuration-layer/describe-package)
|
|
|
|
(spacemacs||set-helm-key "hds" spacemacs/describe-system-info)
|
|
|
|
(spacemacs||set-helm-key "hdt" describe-theme)
|
|
|
|
(spacemacs||set-helm-key "hdv" describe-variable)
|
|
|
|
(spacemacs||set-helm-key "hI" spacemacs/report-issue)
|
|
|
|
(spacemacs||set-helm-key "hn" view-emacs-news)
|
|
|
|
(spacemacs||set-helm-key "hPs" profiler-start)
|
|
|
|
(spacemacs||set-helm-key "hPk" profiler-stop)
|
|
|
|
(spacemacs||set-helm-key "hPr" profiler-report)
|
|
|
|
(spacemacs||set-helm-key "hPw" profiler-report-write-profile)
|
|
|
|
;; define the key binding at the very end in order to allow the user
|
|
|
|
;; to overwrite any key binding
|
2018-04-12 21:06:44 +00:00
|
|
|
(unless (configuration-layer/layer-usedp 'smex)
|
2016-01-09 14:27:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2021-02-20 20:53:54 +00:00
|
|
|
dotspacemacs-emacs-command-key 'spacemacs/helm-M-x-fuzzy-matching))))
|
|
|
|
;; avoid duplicates in `helm-M-x' history.
|
|
|
|
(setq history-delete-duplicates t))
|
2016-01-04 19:20:54 +00:00
|
|
|
:config
|
|
|
|
(progn
|
2018-06-11 05:30:51 +00:00
|
|
|
(helm-mode)
|
2018-10-27 18:53:43 +00:00
|
|
|
(spacemacs|hide-lighter helm-mode)
|
2016-06-08 09:32:10 +00:00
|
|
|
(advice-add 'helm-grep-save-results-1 :after 'spacemacs//gne-init-helm-grep)
|
2019-12-05 12:24:12 +00:00
|
|
|
;; helm-locate uses es (from everything on windows which doesn't like fuzzy)
|
2016-01-04 19:20:54 +00:00
|
|
|
(helm-locate-set-command)
|
2020-12-20 18:42:08 +00:00
|
|
|
(setq helm-locate-fuzzy-match (and (bound-and-true-p helm-use-fuzzy)
|
|
|
|
(string-match "locate" helm-locate-command)))
|
2018-11-06 11:19:59 +00:00
|
|
|
(setq helm-boring-buffer-regexp-list
|
|
|
|
(append helm-boring-buffer-regexp-list
|
|
|
|
spacemacs-useless-buffers-regexp))
|
|
|
|
(setq helm-white-buffer-regexp-list
|
|
|
|
(append helm-white-buffer-regexp-list
|
|
|
|
spacemacs-useful-buffers-regexp))
|
2021-01-29 10:11:44 +00:00
|
|
|
;; use helm to switch last(/previous) visited buffers with C(-S)-tab
|
|
|
|
(define-key helm-map (kbd "<C-tab>") 'helm-follow-action-forward)
|
|
|
|
(define-key helm-map (kbd "<C-iso-lefttab>") 'helm-follow-action-backward)
|
2016-01-04 19:20:54 +00:00
|
|
|
;; alter helm-bookmark key bindings to be simpler
|
|
|
|
(defun simpler-helm-bookmark-keybindings ()
|
|
|
|
(define-key helm-bookmark-map (kbd "C-d") 'helm-bookmark-run-delete)
|
|
|
|
(define-key helm-bookmark-map (kbd "C-e") 'helm-bookmark-run-edit)
|
2016-01-09 20:45:15 +00:00
|
|
|
(define-key helm-bookmark-map
|
|
|
|
(kbd "C-f") 'helm-bookmark-toggle-filename)
|
|
|
|
(define-key helm-bookmark-map
|
|
|
|
(kbd "C-o") 'helm-bookmark-run-jump-other-window)
|
2016-01-04 19:20:54 +00:00
|
|
|
(define-key helm-bookmark-map (kbd "C-/") 'helm-bookmark-help))
|
2017-09-07 10:48:13 +00:00
|
|
|
(with-eval-after-load 'helm-bookmark
|
|
|
|
(simpler-helm-bookmark-keybindings))
|
2018-05-18 04:04:00 +00:00
|
|
|
(when (configuration-layer/package-used-p 'winum)
|
|
|
|
(define-key helm-buffer-map
|
|
|
|
(kbd "RET") 'spacemacs/helm-find-buffers-windows)
|
|
|
|
(define-key helm-generic-files-map
|
|
|
|
(kbd "RET") 'spacemacs/helm-find-files-windows)
|
|
|
|
(define-key helm-find-files-map
|
|
|
|
(kbd "RET") 'spacemacs/helm-find-files-windows)))))
|
2016-01-04 19:20:54 +00:00
|
|
|
|
2016-05-16 02:24:27 +00:00
|
|
|
(defun helm/init-helm-ag ()
|
2016-01-04 19:20:54 +00:00
|
|
|
(use-package helm-ag
|
2018-03-31 05:05:06 +00:00
|
|
|
:defer (spacemacs/defer)
|
2016-01-04 19:20:54 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2018-05-21 05:17:14 +00:00
|
|
|
(setq helm-ag-use-grep-ignore-list t)
|
2016-01-04 19:20:54 +00:00
|
|
|
;; This overrides the default C-s action in helm-projectile-switch-project
|
2016-10-20 00:29:06 +00:00
|
|
|
;; to search using rg/ag/pt/whatever instead of just grep
|
2016-01-04 19:20:54 +00:00
|
|
|
(with-eval-after-load 'helm-projectile
|
|
|
|
(define-key helm-projectile-projects-map
|
2019-12-05 14:19:17 +00:00
|
|
|
(kbd "C-s") 'spacemacs/helm-projectile-grep)
|
|
|
|
;; `spacemacs/helm-projectile-grep' calls:
|
|
|
|
;; `spacemacs/helm-project-smart-do-search-in-dir'
|
|
|
|
;; which needs to be an action.
|
|
|
|
;; Delete the current action.
|
|
|
|
(helm-delete-action-from-source
|
|
|
|
"Grep in projects `C-s'" helm-source-projectile-projects)
|
|
|
|
(helm-add-action-to-source
|
|
|
|
"Search in projects `C-s'"
|
|
|
|
'spacemacs/helm-project-smart-do-search-in-dir
|
|
|
|
helm-source-projectile-projects))
|
2016-01-04 19:20:54 +00:00
|
|
|
|
|
|
|
;; evilify the helm-grep buffer
|
|
|
|
(evilified-state-evilify helm-grep-mode helm-grep-mode-map
|
|
|
|
(kbd "q") 'quit-window)
|
|
|
|
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
;; helm-ag marks
|
|
|
|
"s`" 'helm-ag-pop-stack
|
|
|
|
;; opened buffers scope
|
|
|
|
"sb" 'spacemacs/helm-buffers-smart-do-search
|
|
|
|
"sB" 'spacemacs/helm-buffers-smart-do-search-region-or-symbol
|
|
|
|
"sab" 'helm-do-ag-buffers
|
|
|
|
"saB" 'spacemacs/helm-buffers-do-ag-region-or-symbol
|
|
|
|
"skb" 'spacemacs/helm-buffers-do-ack
|
|
|
|
"skB" 'spacemacs/helm-buffers-do-ack-region-or-symbol
|
2016-10-20 00:29:06 +00:00
|
|
|
"srb" 'spacemacs/helm-buffers-do-rg
|
|
|
|
"srB" 'spacemacs/helm-buffers-do-rg-region-or-symbol
|
2016-01-04 19:20:54 +00:00
|
|
|
"stb" 'spacemacs/helm-buffers-do-pt
|
|
|
|
"stB" 'spacemacs/helm-buffers-do-pt-region-or-symbol
|
|
|
|
;; current file scope
|
|
|
|
"ss" 'spacemacs/helm-file-smart-do-search
|
|
|
|
"sS" 'spacemacs/helm-file-smart-do-search-region-or-symbol
|
|
|
|
"saa" 'helm-ag-this-file
|
|
|
|
"saA" 'spacemacs/helm-file-do-ag-region-or-symbol
|
|
|
|
;; files scope
|
|
|
|
"sf" 'spacemacs/helm-files-smart-do-search
|
|
|
|
"sF" 'spacemacs/helm-files-smart-do-search-region-or-symbol
|
|
|
|
"saf" 'helm-do-ag
|
|
|
|
"saF" 'spacemacs/helm-files-do-ag-region-or-symbol
|
|
|
|
"skf" 'spacemacs/helm-files-do-ack
|
|
|
|
"skF" 'spacemacs/helm-files-do-ack-region-or-symbol
|
2016-10-20 00:29:06 +00:00
|
|
|
"srf" 'spacemacs/helm-files-do-rg
|
|
|
|
"srF" 'spacemacs/helm-files-do-rg-region-or-symbol
|
2016-01-04 19:20:54 +00:00
|
|
|
"stf" 'spacemacs/helm-files-do-pt
|
|
|
|
"stF" 'spacemacs/helm-files-do-pt-region-or-symbol
|
2017-06-19 19:17:12 +00:00
|
|
|
;; current dir scope
|
|
|
|
"sd" 'spacemacs/helm-dir-smart-do-search
|
|
|
|
"sD" 'spacemacs/helm-dir-smart-do-search-region-or-symbol
|
|
|
|
"sad" 'spacemacs/helm-dir-do-ag
|
|
|
|
"saD" 'spacemacs/helm-dir-do-ag-region-or-symbol
|
|
|
|
"skd" 'spacemacs/helm-dir-do-ack
|
|
|
|
"skD" 'spacemacs/helm-dir-do-ack-region-or-symbol
|
|
|
|
"srd" 'spacemacs/helm-dir-do-rg
|
|
|
|
"srD" 'spacemacs/helm-dir-do-rg-region-or-symbol
|
|
|
|
"std" 'spacemacs/helm-dir-do-pt
|
|
|
|
"stD" 'spacemacs/helm-dir-do-pt-region-or-symbol
|
2016-01-04 19:20:54 +00:00
|
|
|
;; current project scope
|
|
|
|
"/" 'spacemacs/helm-project-smart-do-search
|
|
|
|
"*" 'spacemacs/helm-project-smart-do-search-region-or-symbol
|
|
|
|
"sp" 'spacemacs/helm-project-smart-do-search
|
|
|
|
"sP" 'spacemacs/helm-project-smart-do-search-region-or-symbol
|
|
|
|
"sap" 'spacemacs/helm-project-do-ag
|
|
|
|
"saP" 'spacemacs/helm-project-do-ag-region-or-symbol
|
|
|
|
"skp" 'spacemacs/helm-project-do-ack
|
|
|
|
"skP" 'spacemacs/helm-project-do-ack-region-or-symbol
|
2016-10-20 00:29:06 +00:00
|
|
|
"srp" 'spacemacs/helm-project-do-rg
|
|
|
|
"srP" 'spacemacs/helm-project-do-rg-region-or-symbol
|
2016-01-04 19:20:54 +00:00
|
|
|
"stp" 'spacemacs/helm-project-do-pt
|
|
|
|
"stP" 'spacemacs/helm-project-do-pt-region-or-symbol))
|
|
|
|
:config
|
|
|
|
(progn
|
2016-06-08 09:32:10 +00:00
|
|
|
(advice-add 'helm-ag--save-results :after 'spacemacs//gne-init-helm-ag)
|
2016-01-04 19:20:54 +00:00
|
|
|
(evil-define-key 'normal helm-ag-map "SPC" spacemacs-default-map)
|
|
|
|
(evilified-state-evilify helm-ag-mode helm-ag-mode-map
|
2016-03-05 05:38:27 +00:00
|
|
|
(kbd "gr") 'helm-ag--update-save-results
|
2016-01-04 19:20:54 +00:00
|
|
|
(kbd "q") 'quit-window))))
|
|
|
|
|
2016-05-16 02:24:27 +00:00
|
|
|
(defun helm/init-helm-descbinds ()
|
2016-01-04 19:20:54 +00:00
|
|
|
(use-package helm-descbinds
|
2018-03-31 05:05:06 +00:00
|
|
|
:defer (spacemacs/defer)
|
2016-01-04 19:20:54 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq helm-descbinds-window-style 'split)
|
|
|
|
(add-hook 'helm-mode-hook 'helm-descbinds-mode)
|
|
|
|
(spacemacs/set-leader-keys "?" 'helm-descbinds))))
|
|
|
|
|
2018-01-11 04:57:18 +00:00
|
|
|
(defun helm/pre-init-helm-flx ()
|
2016-01-04 19:20:54 +00:00
|
|
|
(spacemacs|use-package-add-hook helm
|
|
|
|
:pre-config
|
|
|
|
(progn
|
|
|
|
;; Disable for helm-find-files until performance issues are sorted
|
|
|
|
;; https://github.com/PythonNut/helm-flx/issues/9
|
|
|
|
(setq helm-flx-for-helm-find-files nil)
|
|
|
|
(helm-flx-mode))))
|
|
|
|
|
2018-01-11 04:57:18 +00:00
|
|
|
(defun helm/init-helm-flx ()
|
2018-03-31 05:05:06 +00:00
|
|
|
(use-package helm-flx
|
|
|
|
:defer (spacemacs/defer)))
|
2018-01-11 04:57:18 +00:00
|
|
|
|
2019-10-27 21:07:20 +00:00
|
|
|
(defun helm/init-helm-ls-git ()
|
|
|
|
(use-package helm-ls-git
|
|
|
|
:defer t
|
2020-10-26 22:11:54 +00:00
|
|
|
:init (spacemacs/set-leader-keys "gff" 'helm-ls-git-ls)
|
|
|
|
:config
|
|
|
|
;; Set `helm-ls-git-status-command' conditonally on `git' layer
|
|
|
|
;; If `git' is in use, use default `\'magit-status-setup-buffer'
|
|
|
|
;; Otherwise, use defaault `\'vc-dir'
|
|
|
|
(when (configuration-layer/package-usedp 'magit)
|
|
|
|
(setq helm-ls-git-status-command 'magit-status-setup-buffer))))
|
2019-10-27 21:07:20 +00:00
|
|
|
|
2016-05-16 02:24:27 +00:00
|
|
|
(defun helm/init-helm-make ()
|
2016-01-04 19:20:54 +00:00
|
|
|
(use-package helm-make
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2016-01-04 19:20:54 +00:00
|
|
|
:init
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"cc" 'helm-make-projectile
|
|
|
|
"cm" 'helm-make)))
|
|
|
|
|
2016-05-16 02:24:27 +00:00
|
|
|
(defun helm/init-helm-mode-manager ()
|
2016-01-04 19:20:54 +00:00
|
|
|
(use-package helm-mode-manager
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2016-01-04 19:20:54 +00:00
|
|
|
:init
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"hM" 'helm-switch-major-mode
|
|
|
|
;; "hm" 'helm-disable-minor-mode
|
|
|
|
"h C-m" 'helm-enable-minor-mode)))
|
|
|
|
|
2020-09-07 02:31:18 +00:00
|
|
|
(defun helm/init-helm-org ()
|
|
|
|
(use-package helm-org
|
|
|
|
:commands (helm-org-in-buffer-headings)
|
|
|
|
:defer (spacemacs/defer)))
|
|
|
|
|
2018-01-11 04:57:18 +00:00
|
|
|
(defun helm/pre-init-helm-projectile ()
|
|
|
|
;; overwrite projectile settings
|
|
|
|
(spacemacs|use-package-add-hook projectile
|
|
|
|
:post-init
|
|
|
|
(progn
|
|
|
|
(setq projectile-switch-project-action 'helm-projectile)
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"pb" 'helm-projectile-switch-to-buffer
|
|
|
|
"pd" 'helm-projectile-find-dir
|
|
|
|
"pf" 'helm-projectile-find-file
|
|
|
|
"pF" 'helm-projectile-find-file-dwim
|
|
|
|
"ph" 'helm-projectile
|
|
|
|
"pp" 'helm-projectile-switch-project
|
|
|
|
"pr" 'helm-projectile-recentf
|
|
|
|
"sgp" 'helm-projectile-grep))))
|
|
|
|
|
2016-05-16 02:24:27 +00:00
|
|
|
(defun helm/init-helm-projectile ()
|
2016-01-04 19:20:54 +00:00
|
|
|
(use-package helm-projectile
|
|
|
|
:commands (helm-projectile-switch-to-buffer
|
|
|
|
helm-projectile-find-dir
|
|
|
|
helm-projectile-dired-find-dir
|
|
|
|
helm-projectile-recentf
|
|
|
|
helm-projectile-find-file
|
|
|
|
helm-projectile-grep
|
|
|
|
helm-projectile
|
|
|
|
helm-projectile-switch-project)
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
;; needed for smart search if user's default tool is grep
|
|
|
|
(defalias 'spacemacs/helm-project-do-grep 'helm-projectile-grep)
|
|
|
|
(defalias
|
2016-06-01 03:19:54 +00:00
|
|
|
'spacemacs/helm-project-do-grep-region-or-symbol
|
2018-01-11 04:57:18 +00:00
|
|
|
'helm-projectile-grep))
|
2018-07-20 20:13:27 +00:00
|
|
|
:config (when (configuration-layer/package-used-p 'winum)
|
|
|
|
(define-key helm-projectile-find-file-map
|
|
|
|
(kbd "RET") 'spacemacs/helm-find-files-windows))))
|
2016-01-04 19:20:54 +00:00
|
|
|
|
2016-05-16 02:24:27 +00:00
|
|
|
(defun helm/init-helm-spacemacs-help ()
|
2016-01-04 19:20:54 +00:00
|
|
|
(use-package helm-spacemacs-help
|
2016-01-13 05:37:26 +00:00
|
|
|
:commands (helm-spacemacs-help-dotspacemacs
|
|
|
|
helm-spacemacs-help
|
|
|
|
helm-spacemacs-help-faq
|
|
|
|
helm-spacemacs-help-layers
|
|
|
|
helm-spacemacs-help-packages
|
|
|
|
helm-spacemacs-help-docs
|
|
|
|
helm-spacemacs-help-toggles)
|
2017-01-16 02:41:17 +00:00
|
|
|
:init (spacemacs/set-leader-keys
|
|
|
|
"h ." 'helm-spacemacs-help-dotspacemacs
|
|
|
|
"h SPC" 'helm-spacemacs-help
|
|
|
|
"h f" 'helm-spacemacs-help-faq
|
|
|
|
"h l" 'helm-spacemacs-help-layers
|
|
|
|
"h p" 'helm-spacemacs-help-packages
|
|
|
|
"h r" 'helm-spacemacs-help-docs
|
|
|
|
"h t" 'helm-spacemacs-help-toggles)))
|
2016-01-04 19:20:54 +00:00
|
|
|
|
2017-01-16 02:53:43 +00:00
|
|
|
(defun helm/init-helm-spacemacs-faq ()
|
|
|
|
(use-package helm-spacemacs-faq
|
|
|
|
:commands helm-spacemacs-help-faq
|
|
|
|
:init (spacemacs/set-leader-keys "h f" 'helm-spacemacs-help-faq)))
|
|
|
|
|
2016-05-16 02:24:27 +00:00
|
|
|
(defun helm/init-helm-swoop ()
|
2016-01-04 19:20:54 +00:00
|
|
|
(use-package helm-swoop
|
2018-03-31 05:05:06 +00:00
|
|
|
:defer (spacemacs/defer)
|
2016-01-04 19:20:54 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq helm-swoop-split-with-multiple-windows t
|
|
|
|
helm-swoop-split-direction 'split-window-vertically
|
2020-10-21 02:10:41 +00:00
|
|
|
helm-swoop-split-window-function 'spacemacs/helm-swoop-split-window-function
|
2016-01-04 19:20:54 +00:00
|
|
|
helm-swoop-pre-input-function (lambda () ""))
|
|
|
|
|
2020-10-21 02:10:41 +00:00
|
|
|
(defun spacemacs/helm-swoop-split-window-function (&rest args)
|
|
|
|
"Override to make helm settings (like `helm-split-window-default-side') work"
|
|
|
|
(let (;; current helm-swoop implemenatation prevents it from being used fullscreen
|
|
|
|
(helm-full-frame nil)
|
|
|
|
(pop-up-windows t))
|
|
|
|
(apply 'helm-default-display-buffer args)))
|
|
|
|
|
2016-01-04 19:20:54 +00:00
|
|
|
(defun spacemacs/helm-swoop-region-or-symbol ()
|
|
|
|
"Call `helm-swoop' with default input."
|
|
|
|
(interactive)
|
|
|
|
(let ((helm-swoop-pre-input-function
|
|
|
|
(lambda ()
|
|
|
|
(if (region-active-p)
|
|
|
|
(buffer-substring-no-properties (region-beginning)
|
|
|
|
(region-end))
|
|
|
|
(let ((thing (thing-at-point 'symbol t)))
|
|
|
|
(if thing thing ""))))))
|
|
|
|
(call-interactively 'helm-swoop)))
|
|
|
|
|
2018-11-14 09:39:31 +00:00
|
|
|
(defun spacemacs/helm-swoop-clear-cache ()
|
|
|
|
"Call `helm-swoop--clear-cache' to clear the cache"
|
|
|
|
(interactive)
|
|
|
|
(helm-swoop--clear-cache)
|
|
|
|
(message "helm-swoop cache cleaned."))
|
|
|
|
|
2016-01-04 19:20:54 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2018-11-14 09:39:31 +00:00
|
|
|
"sC" 'spacemacs/helm-swoop-clear-cache
|
2019-05-12 15:35:35 +00:00
|
|
|
"ss" 'helm-swoop
|
2016-01-04 19:20:54 +00:00
|
|
|
"sS" 'spacemacs/helm-swoop-region-or-symbol
|
|
|
|
"s C-s" 'helm-multi-swoop-all)
|
|
|
|
(defadvice helm-swoop (before add-evil-jump activate)
|
2016-02-15 19:15:29 +00:00
|
|
|
(evil-set-jump)))))
|
2016-01-04 19:20:54 +00:00
|
|
|
|
2016-05-16 02:24:27 +00:00
|
|
|
(defun helm/init-helm-themes ()
|
2016-01-04 19:20:54 +00:00
|
|
|
(use-package helm-themes
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2016-01-04 19:20:54 +00:00
|
|
|
:init
|
|
|
|
(spacemacs/set-leader-keys
|
2017-02-02 05:08:59 +00:00
|
|
|
"Ts" 'spacemacs/helm-themes)))
|
2016-06-17 18:23:48 +00:00
|
|
|
|
2018-02-19 03:48:12 +00:00
|
|
|
(defun helm/init-helm-xref ()
|
|
|
|
(use-package helm-xref
|
2019-08-05 15:30:38 +00:00
|
|
|
:commands (helm-xref-show-xrefs-27 helm-xref-show-xrefs)
|
2018-02-19 03:48:12 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
;; This is required to make `xref-find-references' not give a prompt.
|
|
|
|
;; `xref-find-references' asks the identifier (which has no text property)
|
|
|
|
;; and then passes it to `lsp-mode', which requires the text property at
|
|
|
|
;; point to locate the references.
|
|
|
|
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29619
|
|
|
|
(setq xref-prompt-for-identifier '(not xref-find-definitions
|
|
|
|
xref-find-definitions-other-window
|
|
|
|
xref-find-definitions-other-frame
|
|
|
|
xref-find-references
|
|
|
|
spacemacs/jump-to-definition))
|
|
|
|
;; Use helm-xref to display `xref.el' results.
|
2019-08-05 15:30:38 +00:00
|
|
|
(setq xref-show-xrefs-function (if (< emacs-major-version 27)
|
|
|
|
#'helm-xref-show-xrefs
|
|
|
|
#'helm-xref-show-xrefs-27)))))
|
2018-02-19 03:48:12 +00:00
|
|
|
|
|
|
|
|
2016-08-26 00:42:01 +00:00
|
|
|
(defun helm/post-init-imenu ()
|
|
|
|
(spacemacs/set-leader-keys "ji" 'spacemacs/helm-jump-in-buffer))
|
|
|
|
|
2016-08-02 16:18:28 +00:00
|
|
|
(defun helm/post-init-popwin ()
|
|
|
|
;; disable popwin-mode while Helm session is running
|
|
|
|
(add-hook 'helm-after-initialize-hook #'spacemacs//helm-prepare-display)
|
|
|
|
;; Restore popwin-mode after a Helm session finishes.
|
|
|
|
(add-hook 'helm-cleanup-hook #'spacemacs//helm-restore-display))
|
|
|
|
|
2017-09-26 04:10:00 +00:00
|
|
|
(defun helm/pre-init-persp-mode ()
|
|
|
|
(spacemacs|use-package-add-hook persp-mode
|
|
|
|
:post-config
|
|
|
|
(setq
|
|
|
|
spacemacs--persp-display-buffers-func 'spacemacs/persp-helm-mini
|
|
|
|
spacemacs--persp-display-perspectives-func 'spacemacs/helm-perspectives)))
|
|
|
|
|
2016-06-17 18:23:48 +00:00
|
|
|
(defun helm/post-init-projectile ()
|
|
|
|
(setq projectile-completion-system 'helm))
|