SpaceVim
A modular Vim/Neovim configuration
Home | About | Quick start guide | Documentation | Development | Community | Sponsors | 中文
This layer is for Rust development.
SpaceVim also provides code runner and Language Server Protocol support for Rust. To enable LSP, you need to load the lsp
layer for Rust.
To use this configuration layer, update your custom configuration file with:
[[layers]]
name = "lang#rust"
recommended_style
: true
/false
(Enable/Disable) recommended code style for rust. This option is disabled by default.format_on_save
: true
/false
(Enable/Disable) format current buffer after save. This option is disabled by default.racer_cmd
: The path of racer
binary. This option is racer
by default.rustfmt_cmd
: The path of rustfmt
binary. This option is rustfmt
by default.Key bindings | Descriptions |
---|---|
g d |
Jump to definition |
SPC l d / K |
Show doc of cursor symbol |
SPC l g |
Jump to definition |
SPC l v |
Jump to definition (vertical) |
SPC l e |
Rename symbol (needs lsp layer) |
SPC l u |
Show references (needs lsp layer) |
SPC l c b |
Run cargo build |
SPC l c c |
Run cargo clean |
SPC l c f |
Run cargo fmt |
SPC l c t |
Run cargo test |
SPC l c u |
Run cargo update |
SPC l c B |
Run cargo bench |
SPC l c D |
Run cargo doc |
SPC l c r |
Run cargo run |
SPC l c l |
Run cargo clippy |
Note: SPC l g
and SPC l v
will not be available if the lsp
layer is not enabled.
Start a evcxr
inferior REPL process with SPC l s i
.
Send code to inferior process commands:
Key Bindings | Descriptions |
---|---|
SPC l s b |
send buffer and keep code buffer focused |
SPC l s l |
send line and keep code buffer focused |
SPC l s s |
send selection text and keep code buffer focused |
To run a rust file, you can press SPC l r
to run the current file without losing focus, and the result will be shown in a runner buffer.
Powered by Jekyll