From 4536faa26c0231090dc7ce3bc302154f81f695e4 Mon Sep 17 00:00:00 2001 From: jowj Date: Mon, 4 Mar 2019 00:26:32 -0600 Subject: [PATCH] Add packages and configurations to use emacs as a rust ide. --- applicationConfiguration/.emacs/init.el | 26 ++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/applicationConfiguration/.emacs/init.el b/applicationConfiguration/.emacs/init.el index cbe04b6..9159fe6 100644 --- a/applicationConfiguration/.emacs/init.el +++ b/applicationConfiguration/.emacs/init.el @@ -107,6 +107,11 @@ '(doom-themes outline-magic multiple-cursors + rust-mode + cargo + flycheck-rust + racer + ;;company-mode org2blog pylint python-mode @@ -158,11 +163,9 @@ '(org-modules '(org-bbdb org-bibtex org-docview org-gnus org-habit org-info org-irc org-mhe org-rmail org-w3m)) '(package-selected-packages - '(color-theme-sanityinc-tomorrow org2blog multiple-cursors flymake-python-pyflakes pdf-tools weechat jedi python-mode pylint py-autopep8 powershell outline-magic markdown-mode magit flycheck exec-path-from-shell elpygen elpy ein doom-themes csharp-mode))) + '(racer flycheck-rust rust-mode color-theme-sanityinc-tomorrow org2blog multiple-cursors flymake-python-pyflakes pdf-tools weechat jedi python-mode pylint py-autopep8 powershell outline-magic markdown-mode magit flycheck exec-path-from-shell elpygen elpy ein doom-themes csharp-mode))) -;; run emacs as server (connect to it with `emacsclient`) - ;; PYTHON CONFIGURATION ;; -------------------------------------- @@ -196,4 +199,21 @@ ;; shell confs (exec-path-from-shell-copy-env "PATH") ; copy PATH from shell +;; run emacs as server (connect to it with `emacsclient`) (server-start) + +;; RUST CONFIGURATION +;; -------------------------------------- + +(add-hook 'rust-mode-hook 'cargo-minor-mode) +(add-hook 'flycheck-mode-hook #'flycheck-rust-setup) +(add-hook 'rust-mode-hook + (lambda () + (local-set-key (kbd "C-c ") #'rust-format-buffer))) + +(setq racer-cmd "~/.cargo/bin/racer") ;; Rustup binaries PATH +(setq racer-rust-src-path "~/gitshit/rust/src") ;; Rust source code PATH + +(add-hook 'rust-mode-hook #'racer-mode) +(add-hook 'racer-mode-hook #'eldoc-mode) +(add-hook 'racer-mode-hook #'company-mode)