+ :popup -> set-popup-rule! + :popups -> set-popup-rules! + :company-backend -> set-company-backend! + :evil-state -> set-evil-initial-state! I am slowly phasing out the setting system (def-setting! and set!), starting with these. What are autodefs? These are functions that are always defined, whether or not their respective modules are enabled. However, when their modules are disabled, they are replaced with macros that no-op and don't waste time evaluating their arguments. The old set! function will still work, for a while.
39 lines
1,007 B
EmacsLisp
39 lines
1,007 B
EmacsLisp
;;; lang/rust/config.el -*- lexical-binding: t; -*-
|
|
|
|
(after! rust-mode
|
|
(set! :env "RUST_SRC_PATH")
|
|
(set! :docset 'rust-mode "Rust")
|
|
(setq rust-indent-method-chain t)
|
|
|
|
(map! :map rust-mode-map
|
|
:localleader
|
|
:n "b" #'+rust/build-menu)
|
|
|
|
(def-menu! +rust/build-menu
|
|
"TODO"
|
|
'(("cargo run" :exec "cargo run --color always")
|
|
("cargo build" :exec "cargo build --color always")
|
|
("cargo test" :exec "cargo test --color always"))
|
|
:prompt "Cargo: "))
|
|
|
|
|
|
(def-package! racer
|
|
:after rust-mode
|
|
:config
|
|
(add-hook 'rust-mode-hook #'racer-mode)
|
|
(set! :lookup 'rust-mode
|
|
:definition #'racer-find-definition
|
|
:documentation #'racer-describe))
|
|
|
|
|
|
(def-package! company-racer
|
|
:when (featurep! :completion company)
|
|
:after racer
|
|
:config (set-company-backend! 'rust-mode '(company-racer)))
|
|
|
|
|
|
(def-package! flycheck-rust
|
|
:when (featurep! :feature syntax-checker)
|
|
:after rust-mode
|
|
:config (add-hook! 'rust-mode-hook #'(flycheck-mode flycheck-rust-setup)))
|
|
|