summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-08-22 19:15:19 -0700
committerFranck Cuny <franck@fcuny.net>2022-08-22 19:15:19 -0700
commit3bdea8a56215d04cbf4272d00183dfd81728d510 (patch)
tree08ff560abc1f9f9caf1375ed32fe9bda89b5bfc9
parentfeat(feed): https://pluralistic.net/ (diff)
downloademacs.d-3bdea8a56215d04cbf4272d00183dfd81728d510.tar.gz
feat(rust): add initial configuration for rust
Use rustic and configure it to use eglot as the backend for LSP.

Change-Id: I71bd51a863f1a03b0b3f2d218d970d5ea0867e9e
-rw-r--r--emacs/custom/my-prog.el7
-rw-r--r--emacs/init.el4
2 files changed, 9 insertions, 2 deletions
diff --git a/emacs/custom/my-prog.el b/emacs/custom/my-prog.el
index df56223..7cbc2c7 100644
--- a/emacs/custom/my-prog.el
+++ b/emacs/custom/my-prog.el
@@ -118,10 +118,15 @@
   (add-hook 'before-save-hook #'eglot-format-buffer 100 t))
 
 ;; ensure we load eglot for some specific modes
-(dolist (hook '(go-mode-hook nix-mode-hook))
+(dolist (hook '(go-mode-hook nix-mode-hook rust-mode-hook))
   (add-hook hook 'eglot-ensure)
   (add-hook hook #'my/eglot-install-save-hook))
 
+(require 'rustic)
+(setq rustic-lsp-server 'rust-analyzer
+      rustic-lsp-client 'eglot
+      rustic-format-on-save t)
+
 (provide 'my-prog)
 
 ;;; my-prog.el ends here
diff --git a/emacs/init.el b/emacs/init.el
index bf2ceaf..727103c 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -42,13 +42,15 @@
                           markdown-mode
                           nix-mode
                           notmuch
-                          orderless
                           ol-notmuch
+                          orderless
                           protobuf-mode
                           rg
+                          rustic
                           systemd
                           terraform-doc
                           terraform-mode
+                          toml-mode
                           tree-sitter
                           tree-sitter-langs
                           vertico