feat(corfu,vertico): use equal orderless config
This removes the old `&` separator for Vertico (does anyone use that instead of just space?) in favor of escapable space and unifies orderless config with Corfu. Also implements smart separator insert/escape/reset on `C-SPC` Co-authored-by: Liam Hupfer <liam@hpfr.net>
This commit is contained in:
parent
365a95de76
commit
0588b42b46
5 changed files with 31 additions and 2 deletions
|
@ -46,6 +46,7 @@ Possible values are:
|
|||
(add-to-list 'completion-category-overrides `(lsp-capf (styles ,@completion-styles)))
|
||||
(add-to-list 'corfu-auto-commands #'lispy-colon)
|
||||
(add-to-list 'corfu-continue-commands #'+corfu-move-to-minibuffer)
|
||||
(add-to-list 'corfu-continue-commands #'+corfu-smart-sep-toggle-escape)
|
||||
(add-hook 'evil-insert-state-exit-hook #'corfu-quit))
|
||||
|
||||
(use-package! cape
|
||||
|
@ -118,3 +119,15 @@ Possible values are:
|
|||
:init
|
||||
(after! corfu
|
||||
(add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter)))
|
||||
|
||||
;; If vertico is not enabled, orderless will be installed but not configured.
|
||||
;; That may break smart separator behavior, so we conditionally configure it.
|
||||
(use-package! orderless
|
||||
:when (and (not (modulep! :completion vertico))
|
||||
(modulep! +orderless))
|
||||
:config
|
||||
(setq completion-styles '(orderless basic)
|
||||
completion-category-defaults nil
|
||||
completion-category-overrides '((file (styles orderless partial-completion)))
|
||||
orderless-component-separator #'orderless-escapable-split-on-space)
|
||||
(set-face-attribute 'completions-first-difference nil :inherit nil))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue