diff options
-rw-r--r-- | init.el | 2 | ||||
-rw-r--r-- | lisp/+vertico.el | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/init.el b/init.el index ff686a5..1c4d8e7 100644 --- a/init.el +++ b/init.el | |||
@@ -755,9 +755,11 @@ See also `crux-reopen-as-root-mode'." | |||
755 | :repo "minad/vertico" | 755 | :repo "minad/vertico" |
756 | :files ("*" "extensions/*" | 756 | :files ("*" "extensions/*" |
757 | (:exclude ".git")))) | 757 | (:exclude ".git")))) |
758 | (:also-load +vertico) | ||
758 | (:option resize-mini-windows 'grow-only | 759 | (:option resize-mini-windows 'grow-only |
759 | vertico-count-format nil | 760 | vertico-count-format nil |
760 | vertico-cycle t) | 761 | vertico-cycle t) |
762 | (advice-add 'vertico-next :around '+vertico-ding-wrap) | ||
761 | (when (boundp 'native-comp-deferred-compilation-deny-list) | 763 | (when (boundp 'native-comp-deferred-compilation-deny-list) |
762 | (add-to-list 'native-comp-deferred-compilation-deny-list "vertico")) | 764 | (add-to-list 'native-comp-deferred-compilation-deny-list "vertico")) |
763 | (vertico-mode +1) | 765 | (vertico-mode +1) |
diff --git a/lisp/+vertico.el b/lisp/+vertico.el new file mode 100644 index 0000000..4adde3d --- /dev/null +++ b/lisp/+vertico.el | |||
@@ -0,0 +1,16 @@ | |||
1 | ;;; +vertico.el -*- lexical-binding: t; -*- | ||
2 | |||
3 | ;;; Code: | ||
4 | |||
5 | ;; https://old.reddit.com/r/emacs/comments/rbmfwk/weekly_tips_tricks_c_thread/hof7rz7/ | ||
6 | ;; Add this advice to `vertico-next'. | ||
7 | ;; Takes care of `vertico-previous' as well, since it calls `vertico-next'. | ||
8 | (defun +vertico-ding-wrap (origin &rest args) | ||
9 | "ADVICE to wrap `vertico-next': ding when wrapping." | ||
10 | (let ((beg-index vertico--index)) | ||
11 | (apply origin args) | ||
12 | (unless (eq 1 (abs (- beg-index vertico--index))) | ||
13 | (ding)))) | ||
14 | |||
15 | (provide '+vertico) | ||
16 | ;;; +vertico.el ends here | ||