dev: merging latest changes from pr7002
This commit is contained in:
commit
07b6b399ce
4 changed files with 19 additions and 15 deletions
|
@ -89,6 +89,8 @@ is visible, the following relevant keys are available:
|
||||||
| [[kbd:][M-m]] | Export to minibuffer (if [[doom-module::completion vertico]]) |
|
| [[kbd:][M-m]] | Export to minibuffer (if [[doom-module::completion vertico]]) |
|
||||||
| [[kbd:][M-j]] | (evil) 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:][RET]] | Insert candidate |
|
||||||
|
| [[kbd:][C-RET]] | (in minibuffer) Finish minibuffer without inserting candidate |
|
||||||
|
| [[kbd:][S-RET]] | (in minibuffer) Finish minibuffer after inserting candidate |
|
||||||
| [[kbd:][SPC]] | Quit autocompletion after a wildcard or pass-through |
|
| [[kbd:][SPC]] | Quit autocompletion after a wildcard or pass-through |
|
||||||
| [[kbd:][C-SPC]] | Complete (unless [[doom-module::completion corfu +tng]]) |
|
| [[kbd:][C-SPC]] | Complete (unless [[doom-module::completion corfu +tng]]) |
|
||||||
| [[kbd:][C-SPC]] | (when completing) Insert separator DWIM (see below) |
|
| [[kbd:][C-SPC]] | (when completing) Insert separator DWIM (see below) |
|
||||||
|
@ -141,9 +143,8 @@ A few variables may be set to change behavior of this module:
|
||||||
recommended to leave it at that. Otherwise, single matches on snippet keys
|
recommended to leave it at that. Otherwise, single matches on snippet keys
|
||||||
expand immediately.
|
expand immediately.
|
||||||
- [[var:+corfu-buffer-scanning-size-limit]] ::
|
- [[var:+corfu-buffer-scanning-size-limit]] ::
|
||||||
Sets the maximum buffer size to be scanned by ~cape-dabbrev~ and
|
Sets the maximum buffer size to be scanned by ~cape-dabbrev~. Defaults to 1
|
||||||
~cape-lines~. Defaults to 1 MB. Set this if you are having performance
|
MB. Set this if you are having performance problems using the CAPF.
|
||||||
problems using either CAPF.
|
|
||||||
|
|
||||||
** Adding CAPFs to a mode
|
** Adding CAPFs to a mode
|
||||||
To add other CAPFs on a mode-per-mode basis, put either of the following in your
|
To add other CAPFs on a mode-per-mode basis, put either of the following in your
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
;;; completion/corfu/autoload.el -*- lexical-binding: t; -*-
|
;;; 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
|
;;;###autoload
|
||||||
(defun +corfu-move-to-minibuffer ()
|
(defun +corfu-move-to-minibuffer ()
|
||||||
;; Taken from corfu's README.
|
;; Taken from corfu's README.
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
;;; completion/corfu/config.el -*- lexical-binding: t; -*-
|
;;; completion/corfu/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defvar +corfu-buffer-scanning-size-limit (* 1 1024 1024) ; 1 MB
|
(defvar +corfu-buffer-scanning-size-limit (* 1 1024 1024) ; 1 MB
|
||||||
"Size limit for a buffer to be scanned by `cape-line' or `cape-dabbrev'.
|
"Size limit for a buffer to be scanned by `cape-dabbrev'.")
|
||||||
|
|
||||||
As an exception, `cape-line' will also scan buffers with the same
|
|
||||||
major mode regardless of size.")
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Packages
|
;;; Packages
|
||||||
|
@ -37,12 +34,6 @@ major mode regardless of size.")
|
||||||
tab-always-indent (if (modulep! +tng) 'complete tab-always-indent))
|
tab-always-indent (if (modulep! +tng) 'complete tab-always-indent))
|
||||||
(add-to-list 'completion-category-overrides `(lsp-capf (styles ,@completion-styles)))
|
(add-to-list 'completion-category-overrides `(lsp-capf (styles ,@completion-styles)))
|
||||||
|
|
||||||
(add-hook! corfu-mode
|
|
||||||
(defun +corfu-mode-unbinds ()
|
|
||||||
;; In `corfu-mode', unbind C-SPC from `global-map', so Emacs keeps searching.
|
|
||||||
(make-local-variable 'global-map)
|
|
||||||
(unbind-key "C-SPC" 'global-map)))
|
|
||||||
|
|
||||||
(add-hook! 'minibuffer-setup-hook
|
(add-hook! 'minibuffer-setup-hook
|
||||||
(defun +corfu-enable-in-minibuffer ()
|
(defun +corfu-enable-in-minibuffer ()
|
||||||
"Enable Corfu in the minibuffer if `completion-at-point' is bound."
|
"Enable Corfu in the minibuffer if `completion-at-point' is bound."
|
||||||
|
|
|
@ -475,8 +475,12 @@ Continues comments if executed from a commented line. Consults
|
||||||
"C-S-p" #'corfu-popupinfo-scroll-down
|
"C-S-p" #'corfu-popupinfo-scroll-down
|
||||||
"C-S-n" #'corfu-popupinfo-scroll-up
|
"C-S-n" #'corfu-popupinfo-scroll-up
|
||||||
"C-S-u" (cmd! (funcall-interactively #'corfu-popupinfo-scroll-down corfu-popupinfo-min-height))
|
"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
|
||||||
|
:gi "C-<return>" '(menu-item "Conclude the minibuffer" exit-minibuffer
|
||||||
|
:enable (active-minibuffer-window))
|
||||||
|
:gi "S-<return>" '(menu-item "Insert completion and conclude" +corfu-complete-and-exit-minibuffer
|
||||||
|
:enable (active-minibuffer-window))))
|
||||||
(when-let ((cmds-del (and (modulep! :completion corfu +tng)
|
(when-let ((cmds-del (and (modulep! :completion corfu +tng)
|
||||||
(cmds! (and (> corfu--index -1)
|
(cmds! (and (> corfu--index -1)
|
||||||
(eq corfu-preview-current 'insert))
|
(eq corfu-preview-current 'insert))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue