summaryrefslogtreecommitdiffhomepage
path: root/consult.org
diff options
context:
space:
mode:
Diffstat (limited to 'consult.org')
-rw-r--r--consult.org43
1 files changed, 18 insertions, 25 deletions
diff --git a/consult.org b/consult.org
index d4854aa..0e238ff 100644
--- a/consult.org
+++ b/consult.org
@@ -4,35 +4,37 @@
#+begin_src emacs-lisp
(setq completion-styles '(basic partial-completion emacs22))
#+end_src
-* completion styles: orderless
+* orderless
#+begin_src emacs-lisp :load no
(use-package orderless
:ensure t
- :custom ((completion-styles '(orderless))
- (orderless-component-separator "[ -/]+")
+ :custom ((orderless-component-separator "[ -/]+")
(orderless-matching-styles
'(orderless-literal orderless-regexp orderless-initialism)))
:bind
((:map minibuffer-local-completion-map ("SPC" . self-insert-command))))
#+end_src
-* prescient
- #+begin_src emacs-lisp
- (use-package prescient
- :ensure t
- :custom ((prescient-sort-full-matches-first t)))
-
- (use-package selectrum-prescient :ensure t)
- #+end_src
* selectrum
#+begin_src emacs-lisp
(use-package selectrum
:ensure t
+ :init
+ (defun jao-selectrum--ord-refine (&rest args)
+ (let ((completion-styles '(orderless)))
+ (apply #'selectrum-refine-candidates-using-completions-styles args)))
+
+ (defun jao-selectrum-orderless ()
+ (interactive)
+ (setq selectrum-refine-candidates-function #'jao-selectrum--ord-refine)
+ (setq selectrum-highlight-candidates-function #'orderless-highlight-matches)
+ (setq orderless-skip-highlighting (lambda () selectrum-is-active)))
+
:custom ((selectrum-complete-in-buffer t)
(selectrum-extend-current-candidate-highlight t)
(selectrum-fix-vertical-window-height nil)
(selectrum-max-window-height 20)
(selectrum-show-indices nil)
- (selectrum-count-style 'current/matches)) ;; 'matches
+ (selectrum-count-style 'current/matches))
:bind (("C-R" . selectrum-repeat)))
#+end_src
* marginalia
@@ -284,8 +286,7 @@
(when-let ((url (or (and (derived-mode-p 'w3m-mode)
(or (w3m-anchor) w3m-current-url))
(and (derived-mode-p 'eww-mode)
- (or (thing-at-point 'url)
- (jao-eww-buffer-url)))
+ (or (thing-at-point 'url) (eww-current-url)))
(jao-url-around-point))))
(when (string-match-p "^https?.*" url)
(cons 'url url)))))
@@ -346,15 +347,7 @@
#+end_src
* startup
#+begin_src emacs-lisp
- ;; Use prescient, but only for sorting:
- ;; (setq selectrum-prescient-enable-filtering nil)
-
- (selectrum-prescient-mode 1)
- (prescient-persist-mode 1)
-
- ;; Highlighting only the visible matches:
- (setq orderless-skip-highlighting (lambda () selectrum-is-active))
- (setq selectrum-highlight-candidates-function #'orderless-highlight-matches)
- (add-hook 'after-init-hook #'selectrum-mode)
- (add-hook 'after-init-hook #'marginalia-mode)
+ (marginalia-mode 1)
+ (selectrum-mode 1)
+ (jao-selectrum-orderless)
#+end_src