finish setting up rustic + lsp
This commit is contained in:
parent
3cf6f9b843
commit
b54f0001d8
1 changed files with 28 additions and 25 deletions
|
@ -151,31 +151,34 @@
|
||||||
|
|
||||||
(use-package rustic
|
(use-package rustic
|
||||||
:custom
|
:custom
|
||||||
(rustic-format-trigger 'on-save))
|
(rustic-format-trigger 'on-save)
|
||||||
|
(rustic-analyzer-command '("rustup" "run" "stable" "rust-analyzer")))
|
||||||
|
|
||||||
;; lsp configuration
|
;; lsp integration
|
||||||
(use-package lsp-mode
|
(use-package lsp-mode
|
||||||
:init
|
:ensure
|
||||||
;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
|
:commands lsp
|
||||||
(setq lsp-keymap-prefix "C-c l")
|
:custom
|
||||||
:hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode)
|
;; what to use when checking on-save. "check" is default, I prefer clippy
|
||||||
(prog-mode . lsp)
|
(lsp-rust-analyzer-cargo-watch-command "clippy")
|
||||||
(rustic-mode . lsp)
|
(lsp-eldoc-render-all t)
|
||||||
;; if you want which-key integration
|
(lsp-idle-delay 0.6)
|
||||||
(lsp-mode . lsp-enable-which-key-integration))
|
;; enable / disable the hints as you prefer:
|
||||||
:commands lsp)
|
(lsp-rust-analyzer-server-display-inlay-hints t)
|
||||||
|
(lsp-rust-analyzer-display-lifetime-elision-hints-enable "skip_trivial")
|
||||||
|
(lsp-rust-analyzer-display-chaining-hints t)
|
||||||
|
(lsp-rust-analyzer-display-lifetime-elision-hints-use-parameter-names nil)
|
||||||
|
(lsp-rust-analyzer-display-closure-return-type-hints t)
|
||||||
|
(lsp-rust-analyzer-display-parameter-hints nil)
|
||||||
|
(lsp-rust-analyzer-display-reborrow-hints nil)
|
||||||
|
:config
|
||||||
|
(add-hook 'lsp-mode-hook 'lsp-ui-mode))
|
||||||
|
|
||||||
(use-package company)
|
;; code completion
|
||||||
(custom-set-variables
|
(use-package company
|
||||||
;; custom-set-variables was added by Custom.
|
:after lsp-mode
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
:custom
|
||||||
;; Your init file should contain only one such instance.
|
(company-idle-delay 0.0))
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
'(package-selected-packages
|
(use-package company-box
|
||||||
'(company lsp-mode rustic which-key vertico use-package pdf-tools org-roam magit guess-language expand-region exec-path-from-shell doom-modeline catppuccin-theme)))
|
:hook (company-mode . company-box-mode))
|
||||||
(custom-set-faces
|
|
||||||
;; custom-set-faces was added by Custom.
|
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
|
||||||
;; Your init file should contain only one such instance.
|
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
)
|
|
||||||
|
|
Loading…
Reference in a new issue