doomemacs/modules/module-rust.el
2016-04-04 17:29:47 -04:00

27 lines
733 B
EmacsLisp

;;; module-rust.el
(use-package rust-mode
:mode "\\.rs$"
:config
(define-builder! rust-mode "cargo run" "Cargo.toml")
(define-builder! toml-mode "cargo run" "Cargo.toml")
(use-package flycheck-rust
:config (add-hook 'rust-mode-hook 'flycheck-mode))
(use-package racer
:preface
(setq racer-cmd (concat narf-ext-dir "/racer")
racer-rust-src-path (concat narf-ext-dir "/rust/src/"))
:when (file-exists-p racer-cmd)
:config
(map! :map rust-mode-map :m "gd" 'racer-find-definition)
;; TODO Unit test keybinds
(add-hook! rust-mode '(racer-mode eldoc-mode flycheck-rust-setup))
(define-company-backend! rust-mode (racer))))
(provide 'module-rust)
;;; module-rust.el ends here