doomemacs/modules/module-rust.el

32 lines
883 B
EmacsLisp
Raw Normal View History

2015-09-30 12:28:52 -04:00
;;; module-rust.el
;; NOTE Install instructions
;; brew install rust
;; git clone https://github.com/phildawes/racer.git ~
;; cd ~/racer
;; cargo build --release
;; mv ~/racer/release/racer /usr/local/bin
;; rm -rf ~/racer
(use-package rust-mode
:mode "\\.rs$"
:config
(define-builder! rust-mode "cargo run" "Cargo.toml")
2015-10-18 02:28:36 -04:00
(define-builder! toml-mode "cargo run" "Cargo.toml")
2015-10-08 01:48:47 -04:00
2015-09-30 12:28:52 -04:00
(use-package flycheck-rust
:config (add-hook! rust-mode 'flycheck-mode))
(use-package racer
2015-10-18 02:28:36 -04:00
:if (file-exists-p "/usr/local/bin/racer")
2015-09-30 12:28:52 -04:00
:config
(setq racer-cmd "/usr/local/bin/racer"
racer-rust-src-path "~/Dropbox/lib/rust/src/")
2015-10-18 02:28:36 -04:00
(bind! :map rust-mode-map :m "gd" 'racer-find-definition)
2015-09-30 12:28:52 -04:00
2015-10-08 01:48:47 -04:00
(add-hook! rust-mode '(racer-mode eldoc-mode flycheck-rust-setup))
2015-10-14 03:39:32 -04:00
(define-company-backend! rust-mode (racer))))
2015-09-30 12:28:52 -04:00
(provide 'module-rust)
;;; module-rust.el ends here