summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-09-17 14:12:44 -0700
committerFranck Cuny <franck@fcuny.net>2022-09-17 14:12:44 -0700
commita428e557ce045fb798f8b770beba10637dacdcaa (patch)
tree4809f554867f0b03f8e89b1756111ff2ca8e56f3
parentref(email): remove configuration for notmuch (diff)
downloademacs.d-a428e557ce045fb798f8b770beba10637dacdcaa.tar.gz
feat(lang/rust): configure Emacs for rust
Change-Id: Iaaccc75333b8b36e2fdb0ae4a6eb84408eb61300
Diffstat (limited to '')
-rw-r--r--emacs/custom/my-lang-rust.el19
-rw-r--r--emacs/init.el1
2 files changed, 20 insertions, 0 deletions
diff --git a/emacs/custom/my-lang-rust.el b/emacs/custom/my-lang-rust.el
new file mode 100644
index 0000000..eb8e9a5
--- /dev/null
+++ b/emacs/custom/my-lang-rust.el
@@ -0,0 +1,19 @@
+;;; my-lang-rust.el --- configure emacs for rust -*- lexical-binding: t -*-
+;; Author: Franck Cuny <franck@fcuny.net>
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'rustic)
+(require 'lsp-rust)
+
+(setq rustic-lsp-server 'rust-analyzer)
+(setq rustic-lsp-client 'lsp-mode)
+(setq rustic-format-on-save t)
+
+(add-hook 'rustic-mode-hook #'lsp-rust-analyzer-inlay-hints-mode)
+
+(provide 'my-lang-rust)
+
+;;; my-lang-rust.el ends here
diff --git a/emacs/init.el b/emacs/init.el
index 0aa712d..0a4b12a 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -52,6 +52,7 @@
 (require 'my-lsp)
 (require 'my-lang-go)
 (require 'my-lang-python)
+(require 'my-lang-rust)
 
 (require 'my-buffers)
 (require 'my-git-extra)