2017-06-08 11:47:56 +02:00
|
|
|
;;; lang/rust/config.el -*- lexical-binding: t; -*-
|
2015-09-30 12:28:52 -04:00
|
|
|
|
2017-09-19 05:07:24 +02:00
|
|
|
;;
|
|
|
|
;; Plugins
|
|
|
|
;;
|
2017-02-21 03:46:07 -05:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! rust-mode
|
2015-09-30 12:28:52 -04:00
|
|
|
:mode "\\.rs$"
|
2016-05-01 01:10:30 -04:00
|
|
|
:config
|
2018-03-07 21:21:39 -05:00
|
|
|
(set! :env "RUST_SRC_PATH")
|
2018-03-14 19:06:42 -04:00
|
|
|
(set! :docset 'rust-mode "Rust")
|
2018-03-05 13:43:20 -05:00
|
|
|
(setq rust-indent-method-chain t)
|
2018-03-14 19:07:31 -04:00
|
|
|
|
|
|
|
(map! :map rust-mode-map
|
|
|
|
:localleader
|
|
|
|
:n "b" #'+rust/build-menu)
|
2017-10-03 02:49:08 +02:00
|
|
|
(def-menu! +rust/build-menu
|
|
|
|
"TODO"
|
2018-03-14 19:07:31 -04:00
|
|
|
'(("cargo run" :exec "cargo run --color always")
|
|
|
|
("cargo build" :exec "cargo build --color always")
|
|
|
|
("cargo test" :exec "cargo test --color always"))
|
2017-10-03 02:49:08 +02:00
|
|
|
:prompt "Cargo: "))
|
2015-09-30 12:28:52 -04:00
|
|
|
|
2015-11-30 05:31:20 -05:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! racer
|
2016-04-23 22:08:46 -04:00
|
|
|
:after rust-mode
|
|
|
|
:config
|
2018-04-23 00:34:03 -04:00
|
|
|
(add-hook 'rust-mode-hook #'racer-mode)
|
2018-02-18 03:13:42 -05:00
|
|
|
(set! :lookup 'rust-mode
|
|
|
|
:definition #'racer-find-definition
|
|
|
|
:documentation #'racer-describe))
|
2017-02-19 18:57:16 -05:00
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! company-racer
|
2017-03-19 22:47:50 -04:00
|
|
|
:when (featurep! :completion company)
|
|
|
|
:after racer
|
|
|
|
:config (set! :company-backend 'rust-mode '(company-racer)))
|
2017-02-19 18:57:16 -05:00
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! flycheck-rust
|
2017-03-19 22:47:50 -04:00
|
|
|
:when (featurep! :feature syntax-checker)
|
2017-09-19 05:07:24 +02:00
|
|
|
:after rust-mode
|
2017-12-08 22:33:12 -05:00
|
|
|
:hook (flycheck-mode . flycheck-rust-setup)
|
2018-02-28 17:14:33 -05:00
|
|
|
:init (add-hook 'rust-mode-hook #'flycheck-mode))
|
2015-09-30 12:28:52 -04:00
|
|
|
|