From 4cbf8c30887e5abea6c47b3bc6819adc2e2df03f Mon Sep 17 00:00:00 2001 From: Alexandre Tuleu Date: Wed, 4 Oct 2023 17:30:55 +0200 Subject: [PATCH] Optimizes vertico --- .emacs | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.emacs b/.emacs index 66d4ae6..501d081 100644 --- a/.emacs +++ b/.emacs @@ -10,7 +10,6 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(c-basic-offset 4) - '(company-idle-delay 20.0) '(compilation-scroll-output 'first-error) '(custom-safe-themes '("162201cf5b5899938cfaec99c8cb35a2f1bf0775fc9ccbf5e63130a1ea217213" "e3daa8f18440301f3e54f2093fe15f4fe951986a8628e98dcd781efbec7a46f2" "6622bb651e72d8ebd66454bd86db6c3990324243ff4325c1b6df252aba63b13e" "2f8eadc12bf60b581674a41ddc319a40ed373dd4a7c577933acaff15d2bf7cc6" "f458b92de1f6cf0bdda6bce23433877e94816c3364b821eb4ea9852112f5d7dc" "016f665c0dd5f76f8404124482a0b13a573d17e92ff4eb36a66b409f4d1da410" "13096a9a6e75c7330c1bc500f30a8f4407bd618431c94aeab55c9855731a95e1" "8b148cf8154d34917dfc794b5d0fe65f21e9155977a36a5985f89c09a9669aa0" "bf948e3f55a8cd1f420373410911d0a50be5a04a8886cabe8d8e471ad8fdba8e" "680f62b751481cc5b5b44aeab824e5683cf13792c006aeba1c25ce2d89826426" "631c52620e2953e744f2b56d102eae503017047fb43d65ce028e88ef5846ea3b" default)) @@ -138,6 +137,8 @@ ;; Optionally enable cycling for `vertico-next' and `vertico-previous'. (setq vertico-cycle t) + :config + (vertico-reverse-mode) ) ;; Persist history over Emacs restarts. Vertico sorts by history position. @@ -284,6 +285,7 @@ ;; Consult users will also want the embark-consult package. (use-package embark-consult + :demand t :hook (embark-collect-mode . consult-preview-at-point-mode)) @@ -414,19 +416,24 @@ (use-package company :delight :bind ( ("M-TAB" . company-complete) ) - :config + :init (defun atu/company-prog-mode () "Starts yas company and set up backends accordingly" (yas-minor-mode) (company-mode) - (setq-local company-backends - '( - (company-yasnippet company-capf) - company-files - company-keywords - ) - ) ) + :config + (setq + company-minimum-prefix-length 1 + company-idle-delay 0.5) + (setq company-backends + '( + (company-yasnippet company-capf) + company-files + company-keywords + ) + ) + :hook (prog-mode . atu/company-prog-mode) )