Use Corfu for completion
This commit is contained in:
parent
eaf6b46fbe
commit
fbc05e2931
1 changed files with 34 additions and 15 deletions
49
init.el
49
init.el
|
@ -35,6 +35,9 @@
|
||||||
;; Newline at end of file
|
;; Newline at end of file
|
||||||
(setq require-final-newline t)
|
(setq require-final-newline t)
|
||||||
|
|
||||||
|
;; TAB cycle if there are only few candidates
|
||||||
|
(setq completion-cycle-threshold 3)
|
||||||
|
|
||||||
(prefer-coding-system 'utf-8)
|
(prefer-coding-system 'utf-8)
|
||||||
(set-default-coding-systems 'utf-8)
|
(set-default-coding-systems 'utf-8)
|
||||||
(set-terminal-coding-system 'utf-8)
|
(set-terminal-coding-system 'utf-8)
|
||||||
|
@ -159,6 +162,7 @@
|
||||||
:init
|
:init
|
||||||
(setq completion-styles '(orderless)
|
(setq completion-styles '(orderless)
|
||||||
completion-category-defaults nil
|
completion-category-defaults nil
|
||||||
|
completion-category-overrides nil
|
||||||
completion-category-overrides '((file (styles partial-completion
|
completion-category-overrides '((file (styles partial-completion
|
||||||
orderless)))))
|
orderless)))))
|
||||||
|
|
||||||
|
@ -205,6 +209,22 @@
|
||||||
:hook
|
:hook
|
||||||
(embark-collect-mode . consult-preview-at-point-mode))
|
(embark-collect-mode . consult-preview-at-point-mode))
|
||||||
|
|
||||||
|
(use-package corfu
|
||||||
|
:straight t
|
||||||
|
:custom
|
||||||
|
(corfu-cycle t) ;; Enable cycling for `corfu-next/previous'
|
||||||
|
(corfu-auto t) ;; Enable auto completion
|
||||||
|
(corfu-separator ?\s) ;; Orderless field separator
|
||||||
|
;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary
|
||||||
|
;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match
|
||||||
|
;; (corfu-preview-current nil) ;; Disable current candidate preview
|
||||||
|
;; (corfu-preselect-first nil) ;; Disable candidate preselection
|
||||||
|
;; (corfu-on-exact-match nil) ;; Configure handling of exact matches
|
||||||
|
;; (corfu-echo-documentation nil) ;; Disable documentation in the echo area
|
||||||
|
;; (corfu-scroll-margin 5) ;; Use scroll margin
|
||||||
|
:init
|
||||||
|
(corfu-global-mode))
|
||||||
|
|
||||||
(use-package deadgrep
|
(use-package deadgrep
|
||||||
:straight t
|
:straight t
|
||||||
:bind (("<f5>" . deadgrep)))
|
:bind (("<f5>" . deadgrep)))
|
||||||
|
@ -295,22 +315,21 @@
|
||||||
:hook ((rust-mode . lsp)
|
:hook ((rust-mode . lsp)
|
||||||
(c-mode . lsp)
|
(c-mode . lsp)
|
||||||
(python-mode . lsp))
|
(python-mode . lsp))
|
||||||
:config
|
:custom
|
||||||
(setq lsp-clients-clangd-args
|
(lsp-clients-clangd-args '("-j=2"
|
||||||
'("-j=2"
|
"--background-index"
|
||||||
"--background-index"
|
"--clang-tidy"
|
||||||
"--clang-tidy"
|
"--completion-style=bundled"
|
||||||
"--completion-style=bundled"
|
"--pch-storage=memory"
|
||||||
"--pch-storage=memory"
|
"--header-insertion=never"
|
||||||
"--header-insertion=never"
|
"--header-insertion-decorators=0"
|
||||||
"--header-insertion-decorators=0"
|
"--suggest-missing-includes"))
|
||||||
"--suggest-missing-includes"))
|
|
||||||
;; https://emacs-lsp.github.io/lsp-mode/page/performance/
|
;; https://emacs-lsp.github.io/lsp-mode/page/performance/
|
||||||
(setq read-process-output-max (* 1024 1024)) ;; 1mb
|
(read-process-output-max (* 1024 1024)) ;; 1mb
|
||||||
(setq gc-cons-threshold 100000000)
|
(gc-cons-threshold 100000000)
|
||||||
(setq lsp-completion-provider :capf)
|
(lsp-completion-provider :none)
|
||||||
(setq lsp-file-watch-threshold nil)
|
(lsp-file-watch-threshold nil)
|
||||||
(setq lsp-zig-zls-executable "zls"))
|
(lsp-zig-zls-executable "zls"))
|
||||||
|
|
||||||
(use-package lsp-ui
|
(use-package lsp-ui
|
||||||
:commands lsp-ui-mode
|
:commands lsp-ui-mode
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue