mirror of
https://github.com/doomemacs/doomemacs.git
synced 2025-12-06 02:30:33 -08:00
2.8 KiB
2.8 KiB
lang/rust
Description
This module adds support for the Rust language and integration for its tools,
e.g. cargo.
- Code completion (
racer) - Syntax checking (
flycheck) - LSP support (for rls and rust-analyzer) (
rustic) - Snippets
Module Flags
+lspto add support Language server protocol.
Hacks
- rustic has been modified not to automatically install lsp-mode or elgot if
they're missing. Doom expects you to enable the
:tools lspmodule yourself.
Prerequisites
This module only requires rust, which can be acquired through rustup:
curl https://sh.rustup.rs -sSf | sh
Optionally, this module also uses the following programs:
racer(if not using LSP):cargo +nightly install racer(requires rust nightly)RLSorrust-analyzer(for LSP users)rustfmtfor:editor format:rustup component add rustfmt-preview-
The following commands require:
cargo-process-check:cargo install cargo-checkcargo-process-clippy:rustup component add clippy-preview
Features
This module also supports LSP, if you have the Rust Language Server or
rust-analyzer installed. To enable it, you must enable the :tools lsp module
and the +lsp flag on this module.
Keybinds
| Binding | Description |
|---|---|
<localleader> b a |
cargo audit |
<localleader> b b |
cargo build |
<localleader> b B |
cargo bench |
<localleader> b c |
cargo check |
<localleader> b C |
cargo clippy |
<localleader> b d |
cargo doc |
<localleader> b n |
cargo update |
<localleader> b o |
cargo outdated |
<localleader> b r |
cargo run |
<localleader> t a |
cargo test |
<localleader> t t |
run current test |
TODO Configuration
Enable rust-analyzer
You'll need rust-analyzer installed on your system, then:
(after! rustic
(setq rustic-lsp-server 'rust-analyzer))