2017-06-09 13:36:58 +02:00
|
|
|
;;; completion/helm/config.el -*- lexical-binding: t; -*-
|
2017-02-13 21:12:02 -05:00
|
|
|
|
2018-08-04 20:50:54 +02:00
|
|
|
;; Posframe (requires +childframe)
|
2021-02-24 16:02:32 +00:00
|
|
|
(defvar +helm-posframe-handler #'posframe-poshandler-frame-center
|
|
|
|
"The function that determines the location of the childframe.
|
|
|
|
It should return a cons cell representing the X and Y coordinates. See
|
2018-08-04 20:50:54 +02:00
|
|
|
`posframe-poshandler-frame-center' as a reference.")
|
|
|
|
|
2018-08-07 14:42:58 +02:00
|
|
|
(defvar +helm-posframe-text-scale 1
|
2021-02-24 16:02:32 +00:00
|
|
|
"The text-scale to use in the helm childframe. Set to nil for no scaling.
|
|
|
|
Can be negative.")
|
2018-08-04 20:50:54 +02:00
|
|
|
|
2018-08-07 14:42:58 +02:00
|
|
|
(defvar +helm-posframe-parameters
|
|
|
|
'((internal-border-width . 8)
|
2021-02-16 11:44:59 -05:00
|
|
|
(width . 0.65)
|
2018-08-11 00:27:56 +02:00
|
|
|
(height . 0.35)
|
|
|
|
(min-width . 80)
|
|
|
|
(min-height . 16))
|
2021-02-24 16:02:32 +00:00
|
|
|
"Default parameters for the helm childframe.")
|
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
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! helm-mode
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
:hook (doom-first-input . helm-mode)
|
2018-03-02 23:11:49 -05:00
|
|
|
:config
|
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
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-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
|
|
|
|
helm-ff-auto-update-initial-value nil
|
|
|
|
helm-find-files-doc-header 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
|
2023-02-23 22:39:04 -05:00
|
|
|
;; symbol at point.
|
2018-08-24 01:08:39 +02:00
|
|
|
helm-imenu-execute-action-at-once-if-one nil
|
2023-02-23 22:39:04 -05:00
|
|
|
;; Disable special behavior for left/right, M-left/right keys.
|
2018-08-24 01:08:39 +02:00
|
|
|
helm-ff-lynx-style-map nil)
|
2018-08-04 20:50:54 +02:00
|
|
|
|
2023-02-23 22:39: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 ibuffer-find-file] #'helm-find-files
|
|
|
|
[remap locate] #'helm-locate
|
|
|
|
[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)
|
|
|
|
|
2022-08-12 20:29:19 +02:00
|
|
|
(when (modulep! :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
|
2022-08-12 20:29:19 +02:00
|
|
|
(let ((fuzzy (modulep! +fuzzy)))
|
2020-03-14 20:52:33 +01:00
|
|
|
(setq helm-apropos-fuzzy-match fuzzy
|
2018-08-04 18:41:33 +02:00
|
|
|
helm-bookmark-show-location fuzzy
|
|
|
|
helm-buffers-fuzzy-matching fuzzy
|
2018-08-24 01:07:55 +02:00
|
|
|
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
|
|
|
|
helm-projectile-fuzzy-match fuzzy
|
|
|
|
helm-recentf-fuzzy-match fuzzy
|
2020-03-14 20:52:33 +01:00
|
|
|
helm-semantic-fuzzy-match fuzzy)
|
2023-02-23 22:39:04 -05:00
|
|
|
|
|
|
|
;; Make sure that we have helm-multi-matching or fuzzy matching, (as
|
|
|
|
;; prescribed by the fuzzy flag) also in the following cases:
|
2020-11-05 01:15:08 +01:00
|
|
|
;;
|
2020-03-14 20:52:33 +01:00
|
|
|
;; - helmized commands that use `completion-at-point' and similar functions
|
|
|
|
;; - native commands that fall back to `completion-styles' like `helm-M-x'
|
2020-11-05 01:15:08 +01:00
|
|
|
;;
|
|
|
|
;; However, do not add helm completion styles to the front of
|
|
|
|
;; `completion-styles', since that would be overly intrusive. E.g., it
|
|
|
|
;; results in `company-capf' returning far to many completion candidates.
|
2023-02-23 22:41:03 -05:00
|
|
|
;; Instead, append those styles so that they act as a fallback. Variable
|
|
|
|
;; completion-styles is ignored unless helm-completion-style is customized
|
|
|
|
;; to 'emacs.
|
|
|
|
(setq helm-completion-style 'emacs)
|
2021-07-10 15:52:19 +03:00
|
|
|
(add-to-list 'completion-styles (if fuzzy 'flex 'helm) t))
|
2023-02-23 22:41:03 -05:00
|
|
|
|
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
|
|
|
|
2020-01-23 12:58:39 +01:00
|
|
|
;; Hide minibuffer if `helm-echo-input-in-header-line'
|
|
|
|
(add-hook 'helm-minibuffer-set-up-hook #'helm-hide-minibuffer-maybe)
|
|
|
|
|
:boom: revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.
In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.
doom*shut-up -> doom-shut-up-a
doom*recenter -> doom-recenter-a
+evil*static-reindent -> +evil--static-reindent-a
The rationale behind this change is:
1. Elisp's own formatting/indenting tools would occasionally struggle
with | and * (particularly pp and cl-prettyprint). They have no
problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
github markdown) struggle with it, sometimes refusing to highlight
code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
on haphazardly way back when Doom was simply "my private config".
Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.
Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
macro. The old pair weren't as useful. The new def-advice! saves on a
lot of space.
- Removed "stage" assertions to make sure you were using the right
macros in the right place. Turned out to not be necessary, we'll
employ better checks later.
2019-07-18 15:42:52 +02:00
|
|
|
;; Use helpful instead of describe-* to display documentation
|
|
|
|
(dolist (fn '(helm-describe-variable helm-describe-function))
|
|
|
|
(advice-add fn :around #'doom-use-helpful-a)))
|
2018-03-02 23:11:49 -05:00
|
|
|
|
2023-02-23 22:37:36 -05:00
|
|
|
|
|
|
|
(use-package! helm-posframe
|
|
|
|
:when (modulep! +childframe)
|
|
|
|
:hook (helm-mode . helm-posframe-enable)
|
|
|
|
:config
|
|
|
|
(setq helm-posframe-poshandler #'posframe-poshandler-frame-center
|
|
|
|
helm-posframe-width 0.65
|
|
|
|
helm-posframe-height 0.35
|
|
|
|
helm-posframe-min-width 80
|
|
|
|
helm-posframe-min-height 16
|
|
|
|
helm-posframe-border-width 8))
|
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! helm-flx
|
2022-08-12 20:29:19 +02:00
|
|
|
:when (modulep! +fuzzy)
|
2023-02-23 22:39:04 -05:00
|
|
|
:hook (helm-mode . helm-flx-mode))
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
|
|
|
2019-12-05 16:10:46 -05:00
|
|
|
(after! helm-rg
|
2019-12-06 17:16:34 -05:00
|
|
|
(setq helm-rg-display-buffer-normal-method #'pop-to-buffer)
|
2019-12-05 16:10:46 -05:00
|
|
|
(set-popup-rule! "^helm-rg-" :ttl nil :select t :size 0.45)
|
|
|
|
(map! :map helm-rg-map
|
|
|
|
"C-c C-e" #'helm-rg--bounce)
|
|
|
|
(map! :map helm-rg--bounce-mode-map
|
|
|
|
"q" #'kill-current-buffer
|
2020-06-04 20:02:46 -04:00
|
|
|
"C-c C-c" (cmd! (helm-rg--bounce-dump) (kill-current-buffer))
|
2019-12-05 16:10:46 -05:00
|
|
|
"C-x C-c" #'helm-rg--bounce-dump-current-file
|
|
|
|
"C-c C-k" #'kill-current-buffer))
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
2018-06-16 15:04:27 +02:00
|
|
|
(defvar helm-generic-files-map (make-sparse-keymap))
|
2019-09-22 13:33:26 -04:00
|
|
|
(after! helm-locate
|
|
|
|
(when (and IS-MAC
|
|
|
|
(null helm-locate-command)
|
|
|
|
(executable-find "mdfind"))
|
|
|
|
(setq helm-locate-command "mdfind -name %s"))
|
|
|
|
(set-keymap-parent helm-generic-files-map helm-map))
|
2017-02-13 21:12:02 -05:00
|
|
|
|
|
|
|
|
2019-09-28 23:08:44 -04:00
|
|
|
(use-package! helm-org
|
2022-08-12 20:29:19 +02:00
|
|
|
:when (modulep! :lang org)
|
2019-09-28 23:08:44 -04:00
|
|
|
:defer t
|
|
|
|
:init
|
2019-09-29 01:58:22 -04:00
|
|
|
(after! helm-mode
|
2019-09-28 23:08:44 -04:00
|
|
|
(pushnew! helm-completing-read-handlers-alist
|
|
|
|
'(org-capture . helm-org-completing-read-tags)
|
|
|
|
'(org-set-tags . helm-org-completing-read-tags))))
|
|
|
|
|
|
|
|
|
2023-02-23 22:39:04 -05:00
|
|
|
;; DEPRECATED: Remove when projectile is replaced with project.el
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! helm-projectile
|
2018-06-16 15:04:52 +02:00
|
|
|
:commands (helm-projectile-find-file
|
|
|
|
helm-projectile-recentf
|
|
|
|
helm-projectile-switch-project
|
|
|
|
helm-projectile-switch-to-buffer)
|
|
|
|
:init
|
|
|
|
(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
|
|
|
|
|
|
|
|
2023-02-23 22:39:04 -05:00
|
|
|
(use-package! swiper-helm
|
|
|
|
:defer t
|
|
|
|
:config
|
|
|
|
(setq ivy-height 20
|
|
|
|
swiper-helm-display-function
|
2018-09-08 18:40:11 -04:00
|
|
|
(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))
|
2020-04-11 01:02:21 +04:00
|
|
|
|
|
|
|
|
|
|
|
(use-package! helm-descbinds
|
2020-04-11 00:36:17 -04:00
|
|
|
:hook (helm-mode . helm-descbinds-mode))
|
2021-02-24 16:02:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
(use-package! helm-icons
|
2022-08-12 20:29:19 +02:00
|
|
|
:when (modulep! +icons)
|
2023-02-23 22:39:04 -05:00
|
|
|
:hook (helm-mode . helm-icons-enable)
|
2021-02-24 16:02:32 +00:00
|
|
|
:init
|
|
|
|
(setq helm-icons-provider 'all-the-icons)
|
|
|
|
:config
|
2023-02-23 22:41:42 -05:00
|
|
|
(when (eq helm-icons-provider 'all-the-icons)
|
|
|
|
(setq helm-icons-mode->icon nil)))
|