finally, hover completion and docs

This commit is contained in:
EliasVincent 2025-01-04 00:21:16 +01:00
parent adf6c73340
commit b289b608e9
1 changed files with 22 additions and 6 deletions

View File

@ -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
"<escape>" #'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