From 435c95393459d0c7825a4431f0ebcec6898ba16b Mon Sep 17 00:00:00 2001 From: JSDurand Date: Wed, 9 Feb 2022 22:35:31 +0800 Subject: add configurations for rust * common.el (common): * init.el (rustic-mode): (assoc): * rust-conf.el ("dash.el"): ("s.el"): ("f.el"): (let-alist): ("markdown-mode"): (project): ("rust-mode"): (seq): ("spinner.el"): ("xterm-color"): ("eglot"): (eglot-mode-map): (eglot-autoshutdown): ("rustic"): (rustic-lsp-client): (rustic-format-on-save): (eglot-managed-mode-hook): (durand-rust-mode-hook): (durand-rustic-cargo-doc-a): (#'rustic-cargo-doc): (rust-conf): --- init.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'init.el') diff --git a/init.el b/init.el index 85ddc2e..ca88df7 100644 --- a/init.el +++ b/init.el @@ -382,6 +382,21 @@ no effect." ((add-to-list 'auto-mode-alist (cons "\\.go$" #'go-mode)))) +;;; Rust + +(load-after-function rustic-mode "rust-conf.el" + "Load Rust configurations." nil + (rustic-mode)) + +(cond + ((assoc "\\.rs$" auto-mode-alist #'string=) + (setcdr + (assoc "\\.rs$" auto-mode-alist #'string=) + #'rustic-mode)) + ((add-to-list + 'auto-mode-alist + (cons "\\.rs$" #'rustic-mode)))) + ;;; Cat and mouse (cond ((display-mouse-p) (mouse-avoidance-mode 'none))) -- cgit v1.2.3-18-g5258