2017-06-09 13:36:58 +02:00
|
|
|
;;; completion/helm/config.el -*- lexical-binding: t; -*-
|
2017-02-13 21:12:02 -05:00
|
|
|
|
2018-07-23 00:06:47 +02:00
|
|
|
(defvar +helm-project-search-engines '(rg ag pt)
|
|
|
|
"What search tools for `+helm/project-search' (and `+helm-file-search' when no
|
|
|
|
ENGINE is specified) to try, and in what order.
|
|
|
|
|
|
|
|
To disable a particular tool, remove it from this list. To prioritize a tool
|
|
|
|
over others, move it to the front of the list. Later duplicates in this list are
|
|
|
|
silently ignored.
|
|
|
|
|
2018-08-06 00:21:12 +02:00
|
|
|
This falls back to git-grep (then grep) if none of these available.")
|
2018-07-23 00:06:47 +02:00
|
|
|
|
2018-08-04 20:50:54 +02:00
|
|
|
;; Posframe (requires +childframe)
|
|
|
|
(defvar +helm-posframe-handler
|
|
|
|
#'+helm-poshandler-frame-center-near-bottom
|
|
|
|
"The function that determines the location of the childframe. It should return
|
|
|
|
a cons cell representing the X and Y coordinates. See
|
|
|
|
`posframe-poshandler-frame-center' as a reference.")
|
|
|
|
|
2018-08-07 14:42:58 +02:00
|
|
|
(defvar +helm-posframe-text-scale 1
|
2018-08-04 20:50:54 +02:00
|
|
|
"The text-scale to use in the helm childframe. Set to nil for no scaling. Can
|
|
|
|
be negative.")
|
|
|
|
|
2018-08-07 14:42:58 +02:00
|
|
|
(defvar +helm-posframe-parameters
|
|
|
|
'((internal-border-width . 8)
|
|
|
|
(width . 0.5)
|
2018-08-11 00:27:56 +02:00
|
|
|
(height . 0.35)
|
|
|
|
(min-width . 80)
|
|
|
|
(min-height . 16))
|
2018-08-07 14:42:58 +02:00
|
|
|
"TODO")
|
2018-08-05 21:45:21 +02:00
|
|
|
|
2017-02-21 03:46:22 -05:00
|
|
|
|
2017-02-13 21:12:02 -05:00
|
|
|
;;
|
2019-05-19 18:33:33 -04:00
|
|
|
;;; Packages
|
2017-02-13 21:12:02 -05:00
|
|
|
|
2018-03-02 23:11:49 -05:00
|
|
|
(def-package! helm-mode
|
Introduce general.el & rewrite map!
+ Now uses an overriding keymap for leader keys, so that it is always
available, even outside of normal/visual states. In insert/emacs
states, or in sessions where evil is absent, an alternative prefix is
used for leader/localleader keys. See these variables:
+ doom-leader-prefix
+ doom-leader-alt-prefix
+ doom-localleader-prefix
+ doom-localleader-alt-prefix
+ Keybinds now support alternative prefixes through the new :alt-prefix
property. This is useful for non-evil users and non-normal evil
states. By default, this is M-SPC (leader) and M-SPC m (localleader).
+ Removed +evil-commands flag from config/default (moved to
feature/evil/+commands.el).
+ config/default/+bindings.el has been split into
config/default/+{evil,emacs}-bindings.el, which one is loaded depends
on whether evil is present or not. The latter is blank, but will soon
be populated with a keybinding scheme for non-evil users (perhaps
inspired by #641).
+ The define-key! macro has been replaced; it is now an alias for
general-def.
+ Added unmap! as an alias for general-unbind.
+ The following modifier key conventions are now enforced for
consistency, across all OSes:
alt/option = meta
windows/command = super
It used to be
alt/option = alt
windows/command = meta
Many of the default keybinds have been updated to reflect this switch,
but it is likely to affect personal meta/super keybinds!
The map! macro has also been rewritten to use general-define-key. Here
is what has been changed:
+ map! no longer works with characters, e.g. (map! ?x #'do-something) is
no longer supported. Keys must be kbd-able strings like "C-c x" or
vectors like [?C-c ?x].
+ The :map and :map* properties are now the same thing. If specified
keymaps aren't defined when binding keys, it is automatically
deferred.
+ The way you bind local keybinds has changed:
;; Don't do this
(map! :l "a" #'func-a
:l "b" #'func-b)
;; Do this
(map! :map 'local "a" #'func-a
"b" #'func-b)
+ map! now supports the following new blocks:
+ (:if COND THEN-FORM ELSE-FORM...)
+ (:alt-prefix PREFIX KEYS...) -- this prefix will be used for
non-normal evil states. Equivalent to :non-normal-prefix in general.
+ The way you declare a which-key label for a prefix key has changed:
;; before
(map! :desc "label" :prefix "a" ...)
;; now
(map! :prefix ("a" . "label") ...)
+ It used to be that map! supported binding a key to a key sequence,
like so:
(map! "a" [?x]) ; pressing a is like pressing x
This functionality was removed *temporarily* while I figure out the
implementation.
Addresses: #448, #814, #860
Mentioned in: #940
2018-12-22 03:30:04 -05:00
|
|
|
:defer t
|
2018-05-25 00:46:11 +02:00
|
|
|
:after-call pre-command-hook
|
2018-05-25 11:49:59 +02:00
|
|
|
:init
|
Introduce general.el & rewrite map!
+ Now uses an overriding keymap for leader keys, so that it is always
available, even outside of normal/visual states. In insert/emacs
states, or in sessions where evil is absent, an alternative prefix is
used for leader/localleader keys. See these variables:
+ doom-leader-prefix
+ doom-leader-alt-prefix
+ doom-localleader-prefix
+ doom-localleader-alt-prefix
+ Keybinds now support alternative prefixes through the new :alt-prefix
property. This is useful for non-evil users and non-normal evil
states. By default, this is M-SPC (leader) and M-SPC m (localleader).
+ Removed +evil-commands flag from config/default (moved to
feature/evil/+commands.el).
+ config/default/+bindings.el has been split into
config/default/+{evil,emacs}-bindings.el, which one is loaded depends
on whether evil is present or not. The latter is blank, but will soon
be populated with a keybinding scheme for non-evil users (perhaps
inspired by #641).
+ The define-key! macro has been replaced; it is now an alias for
general-def.
+ Added unmap! as an alias for general-unbind.
+ The following modifier key conventions are now enforced for
consistency, across all OSes:
alt/option = meta
windows/command = super
It used to be
alt/option = alt
windows/command = meta
Many of the default keybinds have been updated to reflect this switch,
but it is likely to affect personal meta/super keybinds!
The map! macro has also been rewritten to use general-define-key. Here
is what has been changed:
+ map! no longer works with characters, e.g. (map! ?x #'do-something) is
no longer supported. Keys must be kbd-able strings like "C-c x" or
vectors like [?C-c ?x].
+ The :map and :map* properties are now the same thing. If specified
keymaps aren't defined when binding keys, it is automatically
deferred.
+ The way you bind local keybinds has changed:
;; Don't do this
(map! :l "a" #'func-a
:l "b" #'func-b)
;; Do this
(map! :map 'local "a" #'func-a
"b" #'func-b)
+ map! now supports the following new blocks:
+ (:if COND THEN-FORM ELSE-FORM...)
+ (:alt-prefix PREFIX KEYS...) -- this prefix will be used for
non-normal evil states. Equivalent to :non-normal-prefix in general.
+ The way you declare a which-key label for a prefix key has changed:
;; before
(map! :desc "label" :prefix "a" ...)
;; now
(map! :prefix ("a" . "label") ...)
+ It used to be that map! supported binding a key to a key sequence,
like so:
(map! "a" [?x]) ; pressing a is like pressing x
This functionality was removed *temporarily* while I figure out the
implementation.
Addresses: #448, #814, #860
Mentioned in: #940
2018-12-22 03:30:04 -05:00
|
|
|
(map! [remap apropos] #'helm-apropos
|
|
|
|
[remap find-library] #'helm-locate-library
|
|
|
|
[remap bookmark-jump] #'helm-bookmarks
|
|
|
|
[remap execute-extended-command] #'helm-M-x
|
|
|
|
[remap find-file] #'helm-find-files
|
|
|
|
[remap imenu] #'helm-semantic-or-imenu
|
|
|
|
[remap noop-show-kill-ring] #'helm-show-kill-ring
|
|
|
|
[remap persp-switch-to-buffer] #'+helm/workspace-mini
|
|
|
|
[remap switch-to-buffer] #'helm-buffers-list
|
|
|
|
[remap projectile-find-file] #'+helm/projectile-find-file
|
|
|
|
[remap projectile-recentf] #'helm-projectile-recentf
|
|
|
|
[remap projectile-switch-project] #'helm-projectile-switch-project
|
|
|
|
[remap projectile-switch-to-buffer] #'helm-projectile-switch-to-buffer
|
|
|
|
[remap recentf-open-files] #'helm-recentf
|
|
|
|
[remap yank-pop] #'helm-show-kill-ring)
|
2018-03-02 23:11:49 -05:00
|
|
|
:config
|
2018-05-14 20:45:47 +02:00
|
|
|
(helm-mode +1)
|
2018-08-21 02:57:40 +02:00
|
|
|
;; helm is too heavy for `find-file-at-point'
|
2018-06-23 16:48:58 +02:00
|
|
|
(add-to-list 'helm-completing-read-handlers-alist (cons #'find-file-at-point nil)))
|
2018-03-02 23:11:49 -05:00
|
|
|
|
|
|
|
|
2017-06-09 13:36:58 +02:00
|
|
|
(def-package! helm
|
2018-03-02 23:11:49 -05:00
|
|
|
:after helm-mode
|
2018-08-24 01:08:39 +02:00
|
|
|
:preface
|
2018-05-30 10:52:44 +02:00
|
|
|
(setq helm-candidate-number-limit 50
|
2018-08-05 22:06:46 +02:00
|
|
|
;; Remove extraineous helm UI elements
|
2017-02-13 21:12:02 -05:00
|
|
|
helm-display-header-line nil
|
2018-08-05 22:06:46 +02:00
|
|
|
helm-mode-line-string nil
|
2017-02-13 21:12:02 -05:00
|
|
|
helm-ff-auto-update-initial-value nil
|
|
|
|
helm-find-files-doc-header nil
|
|
|
|
;; Don't override evil-ex's completion
|
2018-08-04 20:50:54 +02:00
|
|
|
helm-mode-handle-completion-in-region nil
|
2018-08-06 00:11:37 +02:00
|
|
|
;; Default helm window sizes
|
2018-08-04 20:50:54 +02:00
|
|
|
helm-display-buffer-default-width nil
|
2018-08-06 00:11:37 +02:00
|
|
|
helm-display-buffer-default-height 0.25
|
|
|
|
;; When calling `helm-semantic-or-imenu', don't immediately jump to
|
|
|
|
;; symbol at point
|
2018-08-24 01:08:39 +02:00
|
|
|
helm-imenu-execute-action-at-once-if-one nil
|
|
|
|
;; disable special behavior for left/right, M-left/right keys.
|
|
|
|
helm-ff-lynx-style-map nil)
|
2018-08-04 20:50:54 +02:00
|
|
|
|
2019-04-21 19:59:44 -04:00
|
|
|
(when (featurep! :editor evil +everywhere)
|
2018-08-24 01:47:44 +02:00
|
|
|
(setq helm-default-prompt-display-function #'+helm--set-prompt-display))
|
|
|
|
|
2018-08-24 01:08:39 +02:00
|
|
|
:init
|
2018-08-04 20:50:54 +02:00
|
|
|
(when (and EMACS26+ (featurep! +childframe))
|
2018-08-10 19:30:51 +02:00
|
|
|
(setq helm-display-function #'+helm-posframe-display)
|
2018-08-05 22:04:33 +02:00
|
|
|
;; Fix "Specified window is not displaying the current buffer" error
|
2018-08-07 12:57:21 +02:00
|
|
|
(advice-add #'posframe--get-font-height :around #'+helm*fix-get-font-height))
|
2017-02-13 21:12:02 -05:00
|
|
|
|
2018-08-04 18:41:33 +02:00
|
|
|
(let ((fuzzy (featurep! +fuzzy)))
|
2018-08-24 01:07:55 +02:00
|
|
|
(setq helm-M-x-fuzzy-match fuzzy
|
2018-08-13 14:02:49 +02:00
|
|
|
helm-ag-fuzzy-match fuzzy
|
2018-08-04 18:41:33 +02:00
|
|
|
helm-apropos-fuzzy-match fuzzy
|
2018-08-24 01:07:55 +02:00
|
|
|
helm-apropos-fuzzy-match fuzzy
|
2018-08-04 18:41:33 +02:00
|
|
|
helm-bookmark-show-location fuzzy
|
|
|
|
helm-buffers-fuzzy-matching fuzzy
|
|
|
|
helm-completion-in-region-fuzzy-match fuzzy
|
2018-08-24 01:07:55 +02:00
|
|
|
helm-completion-in-region-fuzzy-match fuzzy
|
|
|
|
helm-ff-fuzzy-matching fuzzy
|
2018-08-04 18:41:33 +02:00
|
|
|
helm-file-cache-fuzzy-match fuzzy
|
|
|
|
helm-flx-for-helm-locate fuzzy
|
|
|
|
helm-imenu-fuzzy-match fuzzy
|
|
|
|
helm-lisp-fuzzy-completion fuzzy
|
|
|
|
helm-locate-fuzzy-match fuzzy
|
2018-08-24 01:07:55 +02:00
|
|
|
helm-mode-fuzzy-match fuzzy
|
2018-08-04 18:41:33 +02:00
|
|
|
helm-projectile-fuzzy-match fuzzy
|
|
|
|
helm-recentf-fuzzy-match fuzzy
|
|
|
|
helm-semantic-fuzzy-match fuzzy))
|
|
|
|
|
2017-02-13 21:12:02 -05:00
|
|
|
:config
|
2018-10-01 19:58:23 -04:00
|
|
|
(set-popup-rule! "^\\*helm" :vslot -100 :size 0.22 :ttl nil)
|
2018-08-15 23:32:53 +02:00
|
|
|
|
2018-08-15 19:44:09 +02:00
|
|
|
;; Hide the modeline
|
|
|
|
(defun +helm|hide-mode-line (&rest _)
|
|
|
|
(with-current-buffer (helm-buffer-get)
|
|
|
|
(unless helm-mode-line-string
|
|
|
|
(hide-mode-line-mode +1))))
|
|
|
|
(add-hook 'helm-after-initialize-hook #'+helm|hide-mode-line)
|
|
|
|
(advice-add #'helm-display-mode-line :override #'+helm|hide-mode-line)
|
|
|
|
(advice-add #'helm-ag-show-status-default-mode-line :override #'ignore)
|
2017-06-09 13:36:58 +02:00
|
|
|
|
2018-08-06 00:28:26 +02:00
|
|
|
;; TODO Find a better way
|
2018-09-18 17:41:25 -04:00
|
|
|
(defun +helm*use-helpful (orig-fn arg)
|
2018-08-06 00:28:26 +02:00
|
|
|
(cl-letf (((symbol-function #'describe-function)
|
|
|
|
(symbol-function #'helpful-callable))
|
|
|
|
((symbol-function #'describe-variable)
|
|
|
|
(symbol-function #'helpful-variable)))
|
2018-09-18 17:41:25 -04:00
|
|
|
(funcall orig-fn arg)))
|
2018-08-06 00:28:26 +02:00
|
|
|
(advice-add #'helm-describe-variable :around #'+helm*use-helpful)
|
|
|
|
(advice-add #'helm-describe-function :around #'+helm*use-helpful))
|
2018-03-02 23:11:49 -05:00
|
|
|
|
2017-02-13 21:12:02 -05:00
|
|
|
|
2018-05-30 10:52:44 +02:00
|
|
|
(def-package! helm-flx
|
|
|
|
:when (featurep! +fuzzy)
|
2018-08-04 18:41:33 +02:00
|
|
|
:hook (helm-mode . helm-flx-mode)
|
|
|
|
:config (helm-flx-mode +1))
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
|
|
|
2019-05-19 18:33:33 -04:00
|
|
|
;;;###package helm-ag
|
2018-06-16 15:04:27 +02:00
|
|
|
(after! helm-ag
|
2018-07-26 14:48:21 +02:00
|
|
|
(map! :map helm-ag-edit-map :n "RET" #'compile-goto-error)
|
2018-06-16 15:04:27 +02:00
|
|
|
(define-key helm-ag-edit-map [remap quit-window] #'helm-ag--edit-abort)
|
2018-08-13 14:00:51 +02:00
|
|
|
(set-popup-rule! "^\\*helm-ag-edit" :size 0.35 :ttl 0 :quit nil)
|
|
|
|
;; Recenter after jumping to match
|
2019-04-21 23:22:06 -04:00
|
|
|
(advice-add #'helm-ag--find-file-action :after-while #'doom*recenter)
|
|
|
|
;; And record position before jumping
|
|
|
|
(advice-add #'helm-ag--find-file-action :around #'doom*set-jump-maybe))
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
|
|
|
2019-05-19 18:33:33 -04:00
|
|
|
;;;###package helm-bookmark
|
2018-05-31 13:42:07 +02:00
|
|
|
(setq helm-bookmark-show-location t)
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
|
|
|
2019-05-19 18:33:33 -04:00
|
|
|
;;;###package helm-files
|
2018-05-25 11:49:59 +02:00
|
|
|
(after! helm-files
|
2017-02-13 21:12:02 -05:00
|
|
|
(setq helm-boring-file-regexp-list
|
|
|
|
(append (list "\\.projects$" "\\.DS_Store$")
|
2017-06-09 19:44:02 +02:00
|
|
|
helm-boring-file-regexp-list)))
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
|
|
|
2019-05-19 18:33:33 -04:00
|
|
|
;;;###package helm-locate
|
2018-06-16 15:04:27 +02:00
|
|
|
(defvar helm-generic-files-map (make-sparse-keymap))
|
|
|
|
(after! helm-locate (set-keymap-parent helm-generic-files-map helm-map))
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
|
|
|
2019-05-19 18:33:33 -04:00
|
|
|
;;;###package helm-projectile
|
2018-06-16 15:04:52 +02:00
|
|
|
(def-package! helm-projectile
|
|
|
|
:commands (helm-projectile-find-file
|
|
|
|
helm-projectile-recentf
|
|
|
|
helm-projectile-switch-project
|
|
|
|
helm-projectile-switch-to-buffer)
|
|
|
|
:init
|
|
|
|
(setq projectile-completion-system 'helm)
|
|
|
|
(defvar helm-projectile-find-file-map (make-sparse-keymap))
|
|
|
|
:config
|
|
|
|
(set-keymap-parent helm-projectile-find-file-map helm-map))
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
|
|
|
2019-05-19 18:33:33 -04:00
|
|
|
;;;###package swiper-helm
|
2018-09-08 18:40:11 -04:00
|
|
|
(after! swiper-helm
|
|
|
|
(setq swiper-helm-display-function
|
|
|
|
(lambda (buf &optional _resume) (pop-to-buffer buf)))
|
Introduce general.el & rewrite map!
+ Now uses an overriding keymap for leader keys, so that it is always
available, even outside of normal/visual states. In insert/emacs
states, or in sessions where evil is absent, an alternative prefix is
used for leader/localleader keys. See these variables:
+ doom-leader-prefix
+ doom-leader-alt-prefix
+ doom-localleader-prefix
+ doom-localleader-alt-prefix
+ Keybinds now support alternative prefixes through the new :alt-prefix
property. This is useful for non-evil users and non-normal evil
states. By default, this is M-SPC (leader) and M-SPC m (localleader).
+ Removed +evil-commands flag from config/default (moved to
feature/evil/+commands.el).
+ config/default/+bindings.el has been split into
config/default/+{evil,emacs}-bindings.el, which one is loaded depends
on whether evil is present or not. The latter is blank, but will soon
be populated with a keybinding scheme for non-evil users (perhaps
inspired by #641).
+ The define-key! macro has been replaced; it is now an alias for
general-def.
+ Added unmap! as an alias for general-unbind.
+ The following modifier key conventions are now enforced for
consistency, across all OSes:
alt/option = meta
windows/command = super
It used to be
alt/option = alt
windows/command = meta
Many of the default keybinds have been updated to reflect this switch,
but it is likely to affect personal meta/super keybinds!
The map! macro has also been rewritten to use general-define-key. Here
is what has been changed:
+ map! no longer works with characters, e.g. (map! ?x #'do-something) is
no longer supported. Keys must be kbd-able strings like "C-c x" or
vectors like [?C-c ?x].
+ The :map and :map* properties are now the same thing. If specified
keymaps aren't defined when binding keys, it is automatically
deferred.
+ The way you bind local keybinds has changed:
;; Don't do this
(map! :l "a" #'func-a
:l "b" #'func-b)
;; Do this
(map! :map 'local "a" #'func-a
"b" #'func-b)
+ map! now supports the following new blocks:
+ (:if COND THEN-FORM ELSE-FORM...)
+ (:alt-prefix PREFIX KEYS...) -- this prefix will be used for
non-normal evil states. Equivalent to :non-normal-prefix in general.
+ The way you declare a which-key label for a prefix key has changed:
;; before
(map! :desc "label" :prefix "a" ...)
;; now
(map! :prefix ("a" . "label") ...)
+ It used to be that map! supported binding a key to a key sequence,
like so:
(map! "a" [?x]) ; pressing a is like pressing x
This functionality was removed *temporarily* while I figure out the
implementation.
Addresses: #448, #814, #860
Mentioned in: #940
2018-12-22 03:30:04 -05:00
|
|
|
(global-set-key [remap swiper] #'swiper-helm)
|
2018-09-08 18:40:11 -04:00
|
|
|
(add-to-list 'swiper-font-lock-exclude #'+doom-dashboard-mode nil #'eq))
|