From 2a3346f81c21cf8bb26fadc4236012d48228cec8 Mon Sep 17 00:00:00 2001 From: Kevin Cotugno Date: Fri, 23 Feb 2018 12:29:13 -0800 Subject: [PATCH] Add rust-mode --- emacs.d/init.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/emacs.d/init.el b/emacs.d/init.el index 1b47d54..2f2c338 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -199,6 +199,19 @@ useful for alternating between light and dark themes" (lambda () (set (make-local-variable 'company-backends) '(company-go))))) +(use-package rust-mode + :ensure t + :config + (defun rust-run () "Execute 'cargo run'" + (interactive) + (compile "cargo run")) + + (bind-key (kbd "C-c C-c") 'rust-compile rust-mode-map) + (bind-key (kbd "C-c C-r") 'rust-run rust-mode-map) + (setq-local cargo-bin (concat (getenv "HOME") "/.cargo/bin")) + (when (file-exists-p cargo-bin) + (add-to-list 'exec-path cargo-bin))) + (require 'mu4e) (setq mu4e-maildir (concat (getenv "HOME") "/.mail")) (setq mu4e-drafts-folder "/Drafts")