From e217833e8446f234262d6f1611870186b882a967 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 11 Feb 2021 10:45:16 -0600 Subject: Replace selectrum/prescient with icomplete/orderless Selectrum had this weird bug where sometimes it'd flash closed all the time. I'm not sure if this'll fix it -- sometimes the same happens with other buffers -- but I'm also wanting to try a new completion system. --- config.org | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/config.org b/config.org index f8c0f55..88949b9 100644 --- a/config.org +++ b/config.org @@ -747,7 +747,7 @@ to /hide/ those contents. read-file-name-completion-ignore-case t) #+end_src -*** Selectrum :package: +*** COMMENT Selectrum :package: *COMMENT 2021-02-01*: For some reason, selectrum will randomly do a thing where it, like, flashes up and down in the minibuffer? I don't know how to explain @@ -767,18 +767,7 @@ for now .... I just want to see my completions. (selectrum-mode +1) #+end_src -*** COMMENT Icomplete - -#+begin_src emacs-lisp :noweb-ref packages - (straight-use-package 'icomplete-vertical) -#+end_src - -#+begin_src emacs-lisp :noweb-ref modes - (icomplete-mode +1) - (icomplete-vertical-mode +1) -#+end_src - -*** Prescient :package: +*** COMMENT Prescient :package: #+begin_src emacs-lisp :noweb-ref packages (straight-use-package 'prescient) @@ -791,7 +780,7 @@ Prescient can persist itself too. (prescient-persist-mode +1) #+end_src -**** Selectrum integration +**** COMMENT Selectrum integration Let's have =prescient= and =selectrum= work together. @@ -804,6 +793,61 @@ Let's have =prescient= and =selectrum= work together. (selectrum-prescient-mode +1)) #+end_src +*** Icomplete + +#+begin_src emacs-lisp :noweb-ref packages + (straight-use-package 'icomplete-vertical) +#+end_src + +#+begin_src emacs-lisp :noweb-ref settings + (setq-default + completion-styles '(partial-completion substring flex) + completion-category-overrides '((file + (styles basic substring flex)))) + (setq-default + icomplete-delay-completions-threshold 0 + icomplete-max-delay-chars 0 + icomplete-compute-delay 0 + icomplete-show-matches-on-no-input t + icomplete-hide-common-prefix nil + icomplete-with-completion-tables t + icomplete-in-buffer t) +#+end_src + +#+begin_src emacs-lisp :noweb-ref bindings + (with-eval-after-load 'icomplete + (define-key icomplete-minibuffer-map (kbd "") + #'icomplete-forward-completions) + (define-key icomplete-minibuffer-map (kbd "C-n") + #'icomplete-forward-completions) + (define-key icomplete-minibuffer-map (kbd "") + #'icomplete-backward-completions) + (define-key icomplete-minibuffer-map (kbd "C-p") + #'icomplete-backward-completions)) + + (with-eval-after-load 'icomplete-vertical + (define-key icomplete-minibuffer-map (kbd "C-v") + #'icomplete-vertical-toggle)) +#+end_src + +#+begin_src emacs-lisp :noweb-ref modes + (fido-mode -1) ; I take care of this myself + (icomplete-mode +1) + (icomplete-vertical-mode +1) +#+end_src + +*** Orderless :package: + +#+begin_src emacs-lisp :noweb-ref packages + (straight-use-package 'orderless) + (require 'orderless) +#+end_src + +#+begin_src emacs-lisp :noweb-ref settings + (setq-default + completion-styles '(orderless)) +#+end_src + *** Consult :package: #+begin_src emacs-lisp :noweb-ref modes -- cgit 1.4.1-21-gabe81