diff --git a/modules/jenga-rust.el b/modules/jenga-rust.el index 3476e5c..386467c 100644 --- a/modules/jenga-rust.el +++ b/modules/jenga-rust.el @@ -3,28 +3,23 @@ (require 'jenga-functions) (instl 'rust-mode) (instl 'racer) +(instl 'cargo) +(instl 'flycheck-rust) (add-hook 'rust-mode-hook #'racer-mode) (add-hook 'racer-mode-hook #'eldoc-mode) (add-hook 'racer-mode-hook #'company-mode) -(add-hook 'rust-mode-hook 'cargo-minor-mode) +(add-hook 'rust-mode-hook #'cargo-minor-mode) + +(add-hook 'after-init-hook #'global-flycheck-mode) +(add-hook 'flycheck-mode-hook #'flycheck-rust-setup) ;; Turn on Rust mode with *.rs files. (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode)) ;; Auto-format with rustfmt on save. (setq rust-format-on-save t) -;; Show company auto-complete list on *.rs files by pressing TAB. -(define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common) -;; Use M-. keybinding to follow tag. -(define-key rust-mode-map (kbd "M-.") 'racer-find-definition) -;; Use M-h keybinding to open symbol documentation. -(define-key rust-mode-map (kbd "M-h") 'racer-describe) -;; Use C-c C-c keybinding to compile with `cargo build`. -(define-key rust-mode-map (kbd "C-c C-b") 'cargo-process-build) -;; Use C-c C-r keybinding to run with `cargo run`. -(define-key rust-mode-map (kbd "C-c C-r") 'cargo-process-run) -;; Use C-c C-t keybinding to test with `cargo test`. -(define-key rust-mode-map (kbd "C-c C-t") 'cargo-process-test) +(define-key rust-mode-map (kbd "M-.") #'racer-find-definition) +(define-key rust-mode-map (kbd "M-h") #'racer-describe) (provide 'jenga-rust)