doomemacs/modules/module-rust.el

26 lines
736 B
EmacsLisp
Raw Normal View History

2015-10-01 00:28:52 +08:00
;;; module-rust.el
(use-package rust-mode
:mode "\\.rs$"
:config
(define-builder! rust-mode "cargo run" "Cargo.toml")
2015-10-18 14:28:36 +08:00
(define-builder! toml-mode "cargo run" "Cargo.toml")
2015-10-08 13:48:47 +08:00
2015-10-01 00:28:52 +08:00
(use-package flycheck-rust
:config (add-hook! rust-mode 'flycheck-mode))
(use-package racer
2016-03-27 12:46:52 +08:00
:when (file-exists-p (concat narf-ext-dir "/racer"))
2015-10-01 00:28:52 +08:00
:config
2016-03-27 12:46:52 +08:00
(setq racer-cmd (concat narf-ext-dir "/racer")
racer-rust-src-path (concat narf-ext-dir "/rust/src/"))
(map! :map rust-mode-map :m "gd" 'racer-find-definition)
;; TODO Unit test keybinds
2015-10-01 00:28:52 +08:00
2015-10-08 13:48:47 +08:00
(add-hook! rust-mode '(racer-mode eldoc-mode flycheck-rust-setup))
2015-10-14 15:39:32 +08:00
(define-company-backend! rust-mode (racer))))
2015-10-01 00:28:52 +08:00
(provide 'module-rust)
;;; module-rust.el ends here