From b289b608e92e02b48e8d876fb70ec47a6dbad453 Mon Sep 17 00:00:00 2001 From: EliasVincent Date: Sat, 4 Jan 2025 00:21:16 +0100 Subject: [PATCH] finally, hover completion and docs --- config.el | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/config.el b/config.el index a865051..b5f9cec 100644 --- a/config.el +++ b/config.el @@ -131,9 +131,25 @@ (after! lsp-mode (setq lsp-completion-provider :none)) ;; Disable LSP's completion provider -(use-package! corfu - :custom - (corfu-auto t) ;; Enable auto completion - (corfu-auto-prefix 2) ;; Complete after 2 characters - (corfu-auto-delay 0.0) ;; No delay for completion - ;; (corfu-echo-documentation nil)) ;; Disable documentation in echo area +(after! corfu + (setq corfu-auto t ;; Enable auto completion + corfu-auto-delay 0.0 ;; No delay for completion + corfu-auto-prefix 1 ;; Complete after 1 character + corfu-preview-current t ;; Preview current candidate + corfu-preselect 'prompt ;; Preselect first item + corfu-popupinfo-delay '(0.5 . 0.2)) ;; Show docs after 0.5 sec + + ;; VSCode-like keybindings + (map! :map corfu-map + "C-j" #'corfu-next + "C-k" #'corfu-previous + "TAB" #'corfu-insert + "" #'corfu-quit) + + (corfu-popupinfo-mode)) ;; Enable popup documentation + +(after! lsp-ui + (setq lsp-ui-doc-enable t + lsp-ui-doc-show-with-mouse t ;; Show doc on mouse hover + lsp-ui-doc-delay 0.2 ;; Delay before showing + lsp-ui-doc-position 'at-point)) ;; Show at point instead of sidebar