From 73090187d7290c8e8f0425ecd8df187d1a494e58 Mon Sep 17 00:00:00 2001 From: Luigi Sartor Piucco Date: Mon, 11 Dec 2023 19:12:54 -0300 Subject: [PATCH 1/4] fix(corfu): move binds to `:config default` Bindings were moved to the `:config default` module and some keys were adjusted to match Company/other modules. The changes were documented in the README. --- modules/completion/corfu/README.org | 88 +++++++++++++++++------ modules/completion/corfu/config.el | 50 +------------ modules/config/default/+emacs-bindings.el | 9 ++- modules/config/default/+evil-bindings.el | 44 ++++++++++-- modules/config/default/config.el | 33 +++++++++ 5 files changed, 150 insertions(+), 74 deletions(-) diff --git a/modules/completion/corfu/README.org b/modules/completion/corfu/README.org index fe9b09ee0..e9354f8a2 100644 --- a/modules/completion/corfu/README.org +++ b/modules/completion/corfu/README.org @@ -71,27 +71,26 @@ By default, completion gets triggered after typing 2 non-space consecutive characters, or by means of the [[kbd:][C-SPC]] keybinding at any moment. While the popup is visible, the following relevant keys are available: -| Keybind | Description | -|----------+------------------------------------------------------------------| -| [[kbd:][]] | Go to next candidate | -| [[kbd:][]] | Go to previous candidate | -| [[kbd:][C-n]] | Go to next candidate | -| [[kbd:][C-p]] | Go to previous candidate | -| [[kbd:][C-j]] | (evil) Go to next candidate | -| [[kbd:][C-k]] | (evil) Go to previous candidate | -| [[kbd:][C-]] | Go to next doc line | -| [[kbd:][C-]] | Go to previous doc line | -| [[kbd:][C-S-n]] | Go to next doc line | -| [[kbd:][C-S-p]] | Go to previous doc line | -| [[kbd:][C-S-j]] | (evil) Go to next doc line | -| [[kbd:][C-S-k]] | (evil) Go to previous doc line | -| [[kbd:][C-h]] | Toggle documentation (if available) | -| [[kbd:][M-m]] | Export to minibuffer (if [[doom-module::completion vertico]]) | -| [[kbd:][M-j]] | (evil) Export to minibuffer (if [[doom-module::completion vertico]]) | -| [[kbd:][RET]] | Insert candidate | -| [[kbd:][SPC]] | Quit autocompletion after a wildcard or pass-through | -| [[kbd:][C-SPC]] | Complete (unless [[doom-module::completion corfu +tng]]) | -| [[kbd:][C-SPC]] | (when completing) Insert separator DWIM (see below) | +| Keybind | Description | +|----------+-----------------------------------------------------------| +| [[kbd:][]] | Go to next candidate | +| [[kbd:][]] | Go to previous candidate | +| [[kbd:][C-n]] | Go to next candidate | +| [[kbd:][C-p]] | Go to previous candidate | +| [[kbd:][C-j]] | (evil) Go to next candidate | +| [[kbd:][C-k]] | (evil) Go to previous candidate | +| [[kbd:][C-]] | Go to next doc line | +| [[kbd:][C-]] | Go to previous doc line | +| [[kbd:][C-S-n]] | Go to next doc line | +| [[kbd:][C-S-p]] | Go to previous doc line | +| [[kbd:][C-S-j]] | (evil) Go to next doc line | +| [[kbd:][C-S-k]] | (evil) Go to previous doc line | +| [[kbd:][C-h]] | Toggle documentation (if available) | +| [[kbd:][C-S-s]] | Export to minibuffer (if [[doom-module::completion vertico]]) | +| [[kbd:][RET]] | Insert candidate | +| [[kbd:][SPC]] | Quit autocompletion or pass-through after a wildcard | +| [[kbd:][C-SPC]] | Complete (unless [[doom-module::completion corfu +tng]]) | +| [[kbd:][C-SPC]] | (when completing) Insert separator DWIM (see below) | If you prefer a [[kbd:][TAB]]-centric completion style, enable the [[doom-module::completion corfu +tng]] flag so that, instead, you trigger completion with [[kbd:][TAB]], getting the @@ -129,9 +128,42 @@ exported to a consult minibuffer, giving access to all the manipulations the Vertico suite allows. For instance, one could use this to export with [[doom-package:embark]] via [[kbd:][C-c C-l]] and get a buffer with all candidates. +** Manually call generic CAPFs +Completion at point functions have the property that, when called interactively +via their symbol, they work as a call to ~completion-at-point~ where +[[var:completion-at-point-functions]] is bound to that CAPF alone. This allows to +assign generic functions to a binding and call as needed, leaving the default +value used for most completion tasks much leaner (thus, faster and easier to +look through). This module provides some such bindings for Evil users (see the +table below), and you're free map your own of course. Emacs users have to map it +themselves for now, due to the author's lack of knowledge on ergonomic +equivalents to the Evil ones. If you have suggestions, though, we'd be happy to +know! + +| Keybind | Description | +|---------+---------------------------------| +| [[kbd:][C-x]] [[kbd:][C-l]] | (insert-state) ~cape-line~ | +| [[kbd:][C-x]] [[kbd:][C-k]] | (insert-state) ~cape-keyword~ | +| [[kbd:][C-x]] [[kbd:][C-f]] | (insert-state) ~cape-file~ | +| [[kbd:][C-x]] [[kbd:][s]] | (insert-state) ~cape-dict~ | +| [[kbd:][C-x]] [[kbd:][C-s]] | (insert-state) ~yasnippet-capf~ | +| [[kbd:][C-x]] [[kbd:][C-n]] | (insert-state) ~cape-dabbrev~ | +| [[kbd:][C-x]] [[kbd:][C-p]] | (insert-state) ~cape-history~ | + * Configuration A few variables may be set to change behavior of this module: +- [[var:completion-at-point-functions]] :: + This is not a module/package variable, but a builtin Emacs one. Even so, it's + very important to how Corfu works, so we document it here. It contains a list + of functions that are called in turn to generate completion candidates. The + regular (non-lexical) value should contain few entries and they should + generally be context aware, so as to predict what you need. Additional + functions can be added as you get into more and more specific contexts. Also, + there may be cases where you know beforehand the kind of candidate needed, and + want to enable only that one. For this, the variable may be lexically bound to + the correct value, or you may call the CAPF interactively if a single function + is all you need. - [[var:corfu-auto-delay]] :: Number of seconds till completion occurs automatically. Defaults to 0.1. - [[var:corfu-auto-prefix]] :: @@ -158,6 +190,20 @@ To add other CAPFs on a mode-per-mode basis, put either of the following in your see ~add-hook!~'s documentation for additional ways to call it. ~add-hook~ only accepts the quoted arguments form above. +** Adding CAPFs to a key +To add other CAPFs to keys, adapt the snippet below into your ~config.el~: +#+begin_src emacs-lisp +;; For binding inside `corfu-mode-map'. Line 1 ensures the binding only exists +;; after some-mode-hook runs. Line 2 is needed only if the binding can't leak +;; into other Corfu buffers. When neither of the above make sense, the `map!' +;; call is enough. +(add-hook! some-mode ; Only needed if the binding is mode-specific + (make-local-variable 'corfu-mode-map) + (map! :map corfu-mode-map + :prefix "C-x" ; C-x is usually used as prefix, but it's not required + "e" #'cape-emoji)) ; Evil users probably want :i to avoid this in other states +#+end_src + * Troubleshooting [[doom-report:][Report an issue?]] diff --git a/modules/completion/corfu/config.el b/modules/completion/corfu/config.el index 0710b838e..d4bad1f24 100644 --- a/modules/completion/corfu/config.el +++ b/modules/completion/corfu/config.el @@ -32,17 +32,6 @@ tab-always-indent (if (modulep! +tng) 'complete tab-always-indent)) (add-to-list 'completion-category-overrides `(lsp-capf (styles ,@completion-styles))) - (map! :map corfu-mode-map - :e "C-M-i" #'completion-at-point - :i "C-SPC" #'completion-at-point - :n "C-SPC" (cmd! (call-interactively #'evil-insert-state) - (call-interactively #'completion-at-point)) - :v "C-SPC" (cmd! (call-interactively #'evil-change) - (call-interactively #'completion-at-point))) - (map! :unless (modulep! :editor evil) - :map corfu-mode-map - "C-M-i" #'completion-at-point) - (add-hook! 'minibuffer-setup-hook (defun +corfu-enable-in-minibuffer () "Enable Corfu in the minibuffer if `completion-at-point' is bound." @@ -56,32 +45,9 @@ (when (modulep! +icons) (add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter)) - (let ((cmds-del (cmds! (and (modulep! +tng) - (> corfu--index -1) - (eq corfu-preview-current 'insert)) - #'corfu-reset))) - (map! :map corfu-map - [return] #'corfu-insert - "RET" #'corfu-insert - (:when (modulep! +orderless) - " " #'+corfu-smart-sep-toggle-escape) - (:when (modulep! +tng) - [tab] #'corfu-next - [backtab] #'corfu-previous - "TAB" #'corfu-next - "S-TAB" #'corfu-previous - [backspace] cmds-del - "DEL" cmds-del))) - (when (modulep! +orderless) (after! orderless - (setq orderless-component-separator #'orderless-escapable-split-on-space))) - - (after! vertico - (map! :map corfu-map - "M-m" #'+corfu-move-to-minibuffer - (:when (modulep! :editor evil) - "M-J" #'+corfu-move-to-minibuffer)))) + (setq orderless-component-separator #'orderless-escapable-split-on-space)))) (use-package! cape :defer t @@ -175,16 +141,4 @@ (use-package! corfu-popupinfo :hook ((corfu-mode . corfu-popupinfo-mode)) :config - (setq corfu-popupinfo-delay '(0.5 . 1.0)) - (map! :map corfu-map - "C-" #'corfu-popupinfo-scroll-down - "C-" #'corfu-popupinfo-scroll-up - "C-S-p" #'corfu-popupinfo-scroll-down - "C-S-n" #'corfu-popupinfo-scroll-up - "C-h" #'corfu-popupinfo-toggle) - (map! :when (modulep! :editor evil) - :map corfu-popupinfo-map - ;; Reversed because popupinfo assumes opposite of what feels intuitive - ;; with evil. - "C-S-k" #'corfu-popupinfo-scroll-down - "C-S-j" #'corfu-popupinfo-scroll-up)) + (setq corfu-popupinfo-delay '(0.5 . 1.0))) diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index 7aa4dfc41..2402e7885 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -511,7 +511,7 @@ "C-x C-b" #'ibuffer "C-x K" #'doom/kill-this-buffer-in-all-windows - ;;; company-mode + ;;; completion (in-buffer) (:when (modulep! :completion company) "C-;" #'+company/complete (:after company @@ -537,6 +537,13 @@ "C-p" #'company-search-repeat-backward "C-s" (cmd! (company-search-abort) (company-filter-candidates)))) + (:when (modulep! :completion corfu) + :after corfu + (:map corfu-mode-map + "C-M-i" #'completion-at-point) + (:map corfu-popupinfo-map + "C-S-h" #'corfu-popupinfo-toggle)) + ;;; ein notebooks (:after ein:notebook-multilang :map ein:notebook-multilang-mode-map diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index c79c078f6..c935ac948 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -43,7 +43,10 @@ #'yas-expand (and (bound-and-true-p company-mode) (modulep! :completion company +tng)) - #'company-indent-or-complete-common) + #'company-indent-or-complete-common + (and (bound-and-true-p corfu-mode) + (modulep! :completion corfu +tng)) + #'completion-at-point) :m [tab] (cmds! (and (modulep! :editor snippets) (evil-visual-state-p) (or (eq evil-visual-selection 'line) @@ -127,7 +130,7 @@ ;; ;;; Module keybinds -;;; :completion +;;; :completion (in-buffer) (map! (:when (modulep! :completion company) :i "C-@" (cmds! (not (minibufferp)) #'company-complete-common) :i "C-SPC" (cmds! (not (minibufferp)) #'company-complete-common) @@ -156,7 +159,39 @@ "C-s" #'company-filter-candidates [escape] #'company-search-abort))) - (:when (modulep! :completion ivy) + (:when (modulep! :completion corfu) + (:after corfu + (:map corfu-mode-map + :e "C-M-i" #'completion-at-point + (:prefix "C-x" + :i "C-l" #'cape-line + :i "C-k" #'cape-keyword + :i "C-f" #'cape-file + :i "s" #'cape-dict + :i "C-s" #'yasnippet-capf + :i "C-n" #'cape-dabbrev + :i "C-p" #'cape-history) + (:unless (modulep! :completion corfu +tng) + :i "C-SPC" #'completion-at-point + :n "C-SPC" (cmd! (call-interactively #'evil-insert-state) + (call-interactively #'completion-at-point)) + :v "C-SPC" (cmd! (call-interactively #'evil-change) + (call-interactively #'completion-at-point)))) + (:map corfu-map + "C-u" (cmd! (let (corfu-cycle) + (funcall-interactively #'corfu-next (- corfu-count)))) + "C-d" (cmd! (let (corfu-cycle) + (funcall-interactively #'corfu-next corfu-count))))) + (:after corfu-popupinfo + :map corfu-popupinfo-map + ;; Reversed because popupinfo assumes opposite of what feels intuitive + ;; with evil. + "C-S-k" #'corfu-popupinfo-scroll-down + "C-S-j" #'corfu-popupinfo-scroll-up + "C-h" #'corfu-popupinfo-toggle))) + +;;; :completion (separate) +(map! (:when (modulep! :completion ivy) (:after ivy :map ivy-minibuffer-map "C-SPC" #'ivy-call-and-recenter ; preview file @@ -169,7 +204,8 @@ [C-return] #'+ivy/git-grep-other-window-action)) (:when (modulep! :completion helm) - (:after helm :map helm-map + (:after helm + :map helm-map [remap next-line] #'helm-next-line [remap previous-line] #'helm-previous-line [left] #'left-char diff --git a/modules/config/default/config.el b/modules/config/default/config.el index e67adf1e3..b8b8f2c91 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -458,6 +458,39 @@ Continues comments if executed from a commented line. Consults '(evil-ex-completion-map))) "C-s" command)) + (map! :when (modulep! :completion corfu) + :after corfu + (:map corfu-map + [return] #'corfu-insert + "RET" #'corfu-insert + "C-S-s" #'+corfu-move-to-minibuffer + "C-p" #'corfu-previous + "C-n" #'corfu-next + (:when (modulep! :completion corfu +orderless) + [remap completion-at-point] #'+corfu-smart-sep-toggle-escape) + (:when (modulep! :completion corfu +tng) + [tab] #'corfu-next + "TAB" #'corfu-next + [backtab] #'corfu-previous + "S-TAB" #'corfu-previous)) + (:after corfu-popupinfo + :map corfu-popupinfo-map + "C-" #'corfu-popupinfo-scroll-down + "C-" #'corfu-popupinfo-scroll-up + "C-S-p" #'corfu-popupinfo-scroll-down + "C-S-n" #'corfu-popupinfo-scroll-up + "C-S-u" (cmd! (funcall-interactively #'corfu-popupinfo-scroll-down corfu-popupinfo-min-height)) + "C-S-d" (cmd! (funcall-interactively #'corfu-popupinfo-scroll-up corfu-popupinfo-min-height)))) + + (when-let ((cmds-del (and (modulep! :completion corfu +tng) + '(menu-item "Reset completion" corfu-reset + :enable (and (> corfu--index -1) + (eq corfu-preview-current 'insert)))))) + (map! :after corfu + :map corfu-map + [backspace] cmds-del + "DEL" cmds-del)) + ;; Smarter C-a/C-e for both Emacs and Evil. C-a will jump to indentation. ;; Pressing it again will send you to the true bol. Same goes for C-e, except ;; it will ignore comments+trailing whitespace before jumping to eol. From a4c9c4cc44141dd5012bf3f19f853c7c9dadcbd0 Mon Sep 17 00:00:00 2001 From: Luigi Sartor Piucco Date: Thu, 21 Dec 2023 12:07:39 -0300 Subject: [PATCH 2/4] feat(corfu): impl smart confirm in minibuffer An issue when using corfu in the minibuffer was the need for pressing RET twice, since the first only inserts the completion. This commit aliviates that by providing C-RET to ignore completion and conclude the minibuffer imediately and S-RET to insert completion then conclude. --- modules/completion/corfu/README.org | 23 +++++++++++++++++++++++ modules/completion/corfu/autoload.el | 8 ++++++++ modules/config/default/config.el | 8 ++++++-- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/modules/completion/corfu/README.org b/modules/completion/corfu/README.org index e9354f8a2..39633da9f 100644 --- a/modules/completion/corfu/README.org +++ b/modules/completion/corfu/README.org @@ -103,6 +103,29 @@ following additional binds: | [[kbd:][S-TAB]] | (when completing) Go to previous candidate | | [[kbd:][DEL]] | (when completing) Reset completion DWIM-style | +*** Completion in the minibuffer +In the minibuffer, sometimes autocompletion can interfere with your goal; +Imagine you're composing a search pattern incrementally, and you find what you +want early, with only half the word. You then press [[kbd:RET]]. If completion +kicked in as you typed, you may lose the match, since it will complete the +first candidate. On the other hand, if you were paying attention to the +suggestions and selecting one appropriate, that's desired behavior, and you may +even desire to modify the prompt further (if you were composing a command +instead, you may want to extend it after the candidate). To allow better +control, there are 3 confirm bindings when Corfu appears in the minibuffer: + +| Keybind | Description | +|-----------+--------------------------------------------------------------------| +| [[kbd:RET]] | Accept the candidate only | +| [[kbd:C-RET]] | Confirm the current prompt only | +| [[kbd:S-RET]] | Accept the candidate then immediately confirm the completed prompt | + +- Use [[kbd:RET]] when you want to continue composing after completing; +- Use [[kbd:C-RET]] when you already have the desired string, and completing would + break it; +- Use [[kbd:S-RET]] when you know the composition will be finished after completion + (thus avoiding the need to type [[kbd:RET]] twice); + ** Searching with multiple keywords If the [[doom-module::completion corfu +orderless]] flag is enabled, users can perform code completion with multiple search keywords by use of space as the diff --git a/modules/completion/corfu/autoload.el b/modules/completion/corfu/autoload.el index 618aae42d..841802596 100644 --- a/modules/completion/corfu/autoload.el +++ b/modules/completion/corfu/autoload.el @@ -1,5 +1,13 @@ ;;; completion/corfu/autoload.el -*- lexical-binding: t; -*- +;;;###autoload +(defun +corfu-complete-and-exit-minibuffer () + (interactive) + (if (>= corfu--index 0) + (corfu-complete) + (corfu-insert)) + (exit-minibuffer)) + ;;;###autoload (defun +corfu-move-to-minibuffer () ;; Taken from corfu's README. diff --git a/modules/config/default/config.el b/modules/config/default/config.el index b8b8f2c91..1108190f9 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -480,8 +480,12 @@ Continues comments if executed from a commented line. Consults "C-S-p" #'corfu-popupinfo-scroll-down "C-S-n" #'corfu-popupinfo-scroll-up "C-S-u" (cmd! (funcall-interactively #'corfu-popupinfo-scroll-down corfu-popupinfo-min-height)) - "C-S-d" (cmd! (funcall-interactively #'corfu-popupinfo-scroll-up corfu-popupinfo-min-height)))) - + "C-S-d" (cmd! (funcall-interactively #'corfu-popupinfo-scroll-up corfu-popupinfo-min-height))) + (:map corfu-map + "C-" '(menu-item "Conclude the minibuffer" exit-minibuffer + :enable (minibufferp nil t)) + "S-" '(menu-item "Insert completion and conclude" +corfu-complete-and-exit-minibuffer + :enable (minibufferp nil t)))) (when-let ((cmds-del (and (modulep! :completion corfu +tng) '(menu-item "Reset completion" corfu-reset :enable (and (> corfu--index -1) From 159f61a3a139f091b6c26f72de095b6c2b817ffe Mon Sep 17 00:00:00 2001 From: Luigi Sartor Piucco Date: Sun, 4 Feb 2024 17:17:13 -0300 Subject: [PATCH 3/4] feat(corfu): general move-to-minibuffer impl We previously implemented only consult/vertico as a target for export, now we have all of them. It was necessary to use case-by-case conditions, unfortunately, because other UIs have subtle quirks that prevent a single generalized approach to work. Ivy is almost compliant, but it needs beg and end to not be markers. Helm doesn't replace `completion-in-region-function`, it expects to go around the default `completion--in-region`, so a small addition was made to its module, because we weren't doing that. This was likely an oversight due to the non-standard usage. This was fixed here because we need it working for this feature. Ido doesn't implement `completion-in-region` and its `completing-read` is retricted to a list of strings as table, so it's treated the same as absence of a framework, because it lacks the needed features. --- modules/completion/corfu/README.org | 11 +++++------ modules/completion/corfu/autoload.el | 28 +++++++++++++++++++++++----- modules/completion/corfu/config.el | 2 ++ modules/completion/helm/config.el | 1 + 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/modules/completion/corfu/README.org b/modules/completion/corfu/README.org index 39633da9f..642d83cb2 100644 --- a/modules/completion/corfu/README.org +++ b/modules/completion/corfu/README.org @@ -144,12 +144,11 @@ regarding your state. In normal-like states, enter insert then start corfu; in visual-like states, perform [[help:evil-change][evil-change]] (which leaves you in insert state) then start corfu; in insert-like states, start corfu immediatelly. -** Exporting to the minibuffer (requires [[doom-module::completion vertico]]) -When using the [[doom-module::completion vertico]] module, which pulls in the -[[doom-package:consult]] package, the entries shown in the completion popup can be -exported to a consult minibuffer, giving access to all the manipulations the -Vertico suite allows. For instance, one could use this to export with -[[doom-package:embark]] via [[kbd:][C-c C-l]] and get a buffer with all candidates. +** Exporting to the minibuffer +The entries shown in the completion popup can be exported to a ~completing-read~ +minibuffer, giving access to all the manipulations that suite allows. Using +Vertico for instance, one could use this to export with [[doom-package:embark]] via +[[kbd:][C-c C-l]] and get a buffer with all candidates. ** Manually call generic CAPFs Completion at point functions have the property that, when called interactively diff --git a/modules/completion/corfu/autoload.el b/modules/completion/corfu/autoload.el index 841802596..195c49c4c 100644 --- a/modules/completion/corfu/autoload.el +++ b/modules/completion/corfu/autoload.el @@ -10,12 +10,30 @@ ;;;###autoload (defun +corfu-move-to-minibuffer () - ;; Taken from corfu's README. - ;; TODO: extend this to other completion front-ends. + "Move the current list of candidates to your choice of minibuffer completion UI." (interactive) - (let ((completion-extra-properties corfu--extra) - (completion-cycle-threshold completion-cycling)) - (apply #'consult-completion-in-region completion-in-region--data))) + (pcase completion-in-region--data + (`(,beg ,end ,table ,pred ,extras) + (let ((completion-extra-properties extras) + completion-cycle-threshold completion-cycling) + (cond ((and (modulep! :completion vertico) + (fboundp #'consult-completion-in-region)) + (consult-completion-in-region beg end table pred)) + ((and (modulep! :completion ivy) + (fboundp #'ivy-completion-in-region)) + (ivy-completion-in-region (marker-position beg) (marker-position end) table pred)) + ;; Helm is special and wants to _wrap_ `completion--in-region' + ;; instead of replacing it in `completion-in-region-function'. + ((and (modulep! :completion helm) + (fboundp #'helm--completion-in-region) + (advice-member-p #'helm--completion-in-region #'completion--in-region)) + ;; Important: `completion-in-region-function' is set to corfu at + ;; this moment, so `completion-in-region' (single -) doesn't work. + (completion--in-region beg end table pred)) + ;; Ido doesn't implement `completion-in-region', and its + ;; `completing-read' only accepts a plain list of strings as table, + ;; so there's not much we can do with it. + (t (error "No minibuffer completion UI available for moving to!"))))))) ;;;###autoload (defun +corfu-smart-sep-toggle-escape () diff --git a/modules/completion/corfu/config.el b/modules/completion/corfu/config.el index d4bad1f24..41e54d945 100644 --- a/modules/completion/corfu/config.el +++ b/modules/completion/corfu/config.el @@ -32,6 +32,8 @@ tab-always-indent (if (modulep! +tng) 'complete tab-always-indent)) (add-to-list 'completion-category-overrides `(lsp-capf (styles ,@completion-styles))) + (add-to-list 'corfu-continue-commands #'+corfu-move-to-minibuffer) + (add-hook! 'minibuffer-setup-hook (defun +corfu-enable-in-minibuffer () "Enable Corfu in the minibuffer if `completion-at-point' is bound." diff --git a/modules/completion/helm/config.el b/modules/completion/helm/config.el index 7f983f872..109c182fa 100644 --- a/modules/completion/helm/config.el +++ b/modules/completion/helm/config.el @@ -24,6 +24,7 @@ Can be negative.") (use-package! helm-mode :hook (doom-first-input . helm-mode) :config + (advice-add #'completion--in-region :around #'helm--completion-in-region) ;; helm is too heavy for `find-file-at-point' (add-to-list 'helm-completing-read-handlers-alist (cons #'find-file-at-point nil))) From 2776fa2c4bc943a264dbab62b7c4dfdb7c1ee739 Mon Sep 17 00:00:00 2001 From: Luigi Sartor Piucco Date: Sun, 4 Feb 2024 18:19:04 -0300 Subject: [PATCH 4/4] bump: :completion corfu minad/corfu@24dccafeea11 -> minad/corfu@b48d3017a477 minad/cape@18a30f48bb87 -> minad/cape@bfde79ed4403 elken/yasnippet-capf@a0a6b1c2bb6d -> elken/yasnippet-capf@db12b55cd08b --- modules/completion/corfu/packages.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/completion/corfu/packages.el b/modules/completion/corfu/packages.el index ec9edc23f..05f2d9b98 100644 --- a/modules/completion/corfu/packages.el +++ b/modules/completion/corfu/packages.el @@ -1,8 +1,8 @@ ;; -*- no-byte-compile: t; -*- ;;; completion/corfu/packages.el -(package! corfu :pin "24dccafeea114b1aec7118f2a8405b46aa0051e0") -(package! cape :pin "18a30f48bb8754421cb10dad99e0a406173d4551") +(package! corfu :pin "b48d3017a47706198e04440cc1b3483bdf646771") +(package! cape :pin "bfde79ed440343c0dbf0f64cfe7913c1efbe3f83") (when (modulep! +icons) (package! nerd-icons-corfu :pin "7077bb76fefc15aed967476406a19dc5c2500b3c")) (when (modulep! +orderless) @@ -10,4 +10,4 @@ (when (modulep! :os tty) (package! corfu-terminal :pin "501548c3d51f926c687e8cd838c5865ec45d03cc")) (when (modulep! :editor snippets) - (package! yasnippet-capf :pin "a0a6b1c2bb6decdad5cf9b74202f0042f494a6ab")) + (package! yasnippet-capf :pin "db12b55cd08b614cbba134008566e48d7faf660e"))