aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/overlays/kookie/emacs/rust/default.el
blob: 9467b18689bf0d1ff25037d3796437de6a101056 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
;; rust.el
;;   Configure rust development via lsp and rust-analyzer
;;
;; This mode enables IDE-like integration for writing and editing rust
;; mode, as well as projectile.el, a utility to mark projects in a
;; large set of directories such as a monorepo.  This mode depends on
;; all projects in this tree following the projectile conventions.
;;
;;
;; This file is part of LIBKOOKIE, a collection of nix expressions.
;; LIBKOOKIE is licensed under the GPL-3.0 (or later) -- see LICENSE

(provide 'rust)

;;; Use rust-analyzer for completions
(setq lsp-rust-server 'rust-analyzer)

;;; Start lsp mode for Rust buffers
(add-hook 'rust-mode-hook #'lsp)

;;; Use projectile to find project roots
(projectile-mode t)
(setq lsp-auto-guess-root t)

(setq lsp-ui-doc-position 'top)
(setq lsp-ui-doc-max-width 40)
(setq lsp-ui-doc-max-height 20)