The great config remake.
I decided to go back to the basics with this one. Only the packages I think I *REALLY* need (or want) are left, the rest are replaced by the built-in alternatives or even better, removed.
This commit is contained in:
@@ -6,86 +6,6 @@
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; COmpletion in Region FUnction. Corfu enhances in-buffer completion
|
||||
;; with a small completion popup. Corfu is the minimalistic in-buffer
|
||||
;; completion counterpart of the Vertico minibuffer UI.
|
||||
(use-package corfu
|
||||
:ensure t
|
||||
:defer nil
|
||||
:commands (corfu-mode global-corfu-mode)
|
||||
|
||||
:hook ((prog-mode . corfu-mode)
|
||||
(shell-mode . corfu-mode)
|
||||
(eshell-mode . corfu-mode))
|
||||
|
||||
:bind (:map corfu-map
|
||||
("s-SPC" . corfu-insert-separator)
|
||||
("M-d" . corfu-info-documentation)
|
||||
)
|
||||
:custom
|
||||
;; Hide commands in M-x which do not apply to the current mode.
|
||||
(read-extended-command-predicate #'command-completion-default-include-p)
|
||||
;; Disable Ispell completion function. As an alternative try `cape-dict'.
|
||||
(text-mode-ispell-word-completion nil)
|
||||
(tab-always-indent 'complete)
|
||||
|
||||
:init
|
||||
(setq corfu-auto t)
|
||||
(setq tab-always-indent 'complete)
|
||||
(setq corfu-preview-current 'insert)
|
||||
(setq corfu-echo-documentation nil)
|
||||
(setq corfu-popupinfo-delay '(1.0 . 0.5))
|
||||
|
||||
;; Enable Corfu
|
||||
:config
|
||||
(global-corfu-mode t)
|
||||
(corfu-popupinfo-mode t))
|
||||
|
||||
;; This package provides icons to corfu completions. Requires nerd fonts to be
|
||||
;; installed to work.
|
||||
(use-package nerd-icons-corfu
|
||||
:config
|
||||
(add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter))
|
||||
|
||||
;; Cape provides Completion At Point Extensions which can be used in
|
||||
;; combination with Corfu, Company or the default completion UI. The
|
||||
;; completion backends used by completion-at-point are so called
|
||||
;; completion-at-point-functions (Capfs).
|
||||
(use-package cape
|
||||
:ensure t
|
||||
:defer nil
|
||||
:commands (cape-dabbrev cape-file cape-elisp-block)
|
||||
:bind ("C-c p" . cape-prefix-map)
|
||||
:init
|
||||
;; Add to the global default value of `completion-at-point-functions' which is
|
||||
;; used by `completion-at-point'.
|
||||
(add-hook 'completion-at-point-functions #'cape-dabbrev)
|
||||
(add-hook 'completion-at-point-functions #'cape-file)
|
||||
(add-hook 'completion-at-point-functions #'cape-elisp-block))
|
||||
|
||||
;; VERTical Interactive COmpletion. Vertico provides a performant and
|
||||
;; minimalistic vertical completion UI based on the default completion
|
||||
;; system.
|
||||
(use-package vertico
|
||||
;; (Note: It is recommended to also enable the savehist package.)
|
||||
:ensure t
|
||||
:defer t
|
||||
:commands vertico-mode
|
||||
:hook (after-init . vertico-mode))
|
||||
|
||||
;; This package provides an orderless completion style that divides
|
||||
;; the pattern into space-separated components, and matches candidates
|
||||
;; that match all of the components in any order.
|
||||
(use-package orderless
|
||||
;; Vertico leverages Orderless' flexible matching capabilities, allowing users
|
||||
;; to input multiple patterns separated by spaces, which Orderless then
|
||||
;; matches in any order against the candidates.
|
||||
:ensure t
|
||||
:custom
|
||||
(completion-styles '(orderless basic))
|
||||
(completion-category-defaults nil)
|
||||
(completion-category-overrides '((file (styles partial-completion)))))
|
||||
|
||||
;; This package provides marginalia-mode which adds marginalia to the
|
||||
;; minibuffer completions. Marginalia are marks or annotations placed
|
||||
;; at the margin of the page of a book or in this case helpful
|
||||
@@ -231,4 +151,30 @@
|
||||
:preview-key '(:debounce 0.4 any))
|
||||
(setq consult-narrow-key "<"))
|
||||
|
||||
(setq tab-always-indent 'complete) ;; Starts completion with TAB
|
||||
|
||||
(fido-mode -1)
|
||||
(icomplete-mode)
|
||||
(icomplete-vertical-mode)
|
||||
|
||||
(setq icomplete-delay-completions-threshold 0)
|
||||
(setq icomplete-compute-delay 0)
|
||||
(setq icomplete-show-matches-on-no-input t)
|
||||
(setq icomplete-hide-common-prefix nil)
|
||||
(setq icomplete-prospects-height 10)
|
||||
(setq icomplete-separator " . ")
|
||||
(setq icomplete-with-completion-tables t)
|
||||
(setq icomplete-max-delay-chars 0)
|
||||
(setq icomplete-scroll t)
|
||||
|
||||
(keymap-set icomplete-minibuffer-map "RET" 'icomplete-force-complete-and-exit)
|
||||
|
||||
(setq completion-styles '(initials flex basic partial-completion emacs22))
|
||||
(setq completion-auto-select t) ;; Show completion on first call
|
||||
(setq completion-auto-help 'visible) ;; Display *Completions* upon first request
|
||||
(setq completions-format 'one-column) ;; Use only one column
|
||||
(setq completions-sort 'historical) ;; Order based on minibuffer history
|
||||
(setq completions-max-height 15) ;; Limit completions to 10 (completions start at line 5)
|
||||
(setq completion-ignore-case t)
|
||||
|
||||
;;; 10-completion.el ends here
|
||||
|
||||
Reference in New Issue
Block a user