doomemacs/modules/lang/rust/config.el

36 lines
832 B
EmacsLisp
Raw Normal View History

2015-09-30 12:28:52 -04:00
;;; module-rust.el
(defvar +rust-cache-dir (concat doom-cache-dir "+rust/")
"TODO")
2017-02-19 18:57:16 -05:00
(@def-package rust-mode
2015-09-30 12:28:52 -04:00
:mode "\\.rs$"
2017-02-19 18:57:16 -05:00
:init
(add-hook 'rust-mode-hook 'flycheck-mode)
:config
2017-02-19 18:57:16 -05:00
(@set :build 'cargo-run '(rust-mode toml-mode)
'+rust-is-cargo-project-p '+rust/cargo-run))
2015-09-30 12:28:52 -04:00
2017-02-19 18:57:16 -05:00
(@def-package racer
:after rust-mode
:preface
2017-02-19 18:57:16 -05:00
:init
(@add-hook rust-mode '(racer-mode eldoc-mode flycheck-rust-setup))
:config
(setq racer-cmd (expand-file-name "racer/target/release/racer" +rust-cache-dir)
racer-rust-src-path (expand-file-name "rust/src/" +rust-cache-dir))
;; TODO Unit test keybinds
2017-02-19 18:57:16 -05:00
(@set :company-backend 'rust-mode '(company-racer))
(@map :map rust-mode-map :m "gd" 'racer-find-definition))
(@def-package company-racer
:after racer)
(@def-package flycheck-rust
:after rust-mode)
2015-09-30 12:28:52 -04:00