emacs/elisp/init-eglot.el
Mark van der Putten b37385e632 Update config
2025-04-21 15:14:51 +02:00

46 lines
1.3 KiB
EmacsLisp

;;;; Init-eglot.el --- eglot configuration
;;;; Commentary:
;;;; Code:
(use-package eglot
:hook ((rust-mode nix-mode) . eglot-ensure)
:bind (:map eglot-mode-map
("C-c C-d" . eldoc)
("C-c C-e" . eglot-rename)
("C-c C-f" . eglot-format-buffer))
:config (add-to-list 'eglot-server-programs
`(rust-mode . ("rust-analyzer" :initializationOptions
( :procMacro (:enable t)
:cargo ( :buildScripts (:enable t)
:features "all")))))
(add-hook 'after-save-hook 'eglot-format)
;; inlay hints are displayed using the three faces
;; - eglot-type-hint-face,
;; - eglot-parameter-hint-face,
;; - eglot-inlay-hint-face,
;; which all inherit from eglot-inlay-hint-face, which you may customise;
;;
;; Toggle
;; (eglot-inlay-hints-mode)
(set-face-attribute 'eglot-inlay-hint-face nil
:foreground "gray45"
:weight 'bold)
)
;; To install the rust binary applicaton
;; M-x package-vc-install
;; then pass url 'https://github.com/jdtsmith/eglot-booster'
;; cargo build --release
;; Copy binary to /usr/local/bin
;; (use-package eglot-booster
;; :ensure t
;; :after eglot
;; :config
;; (eglot-booster-mode))
(provide 'init-eglot)
;;; init-eglot.el ends here