From 29c10f0b3beed744e8b8c95349e2b6f577269630 Mon Sep 17 00:00:00 2001 From: Grafcube Date: Tue, 25 Jan 2022 18:52:30 +0530 Subject: [PATCH] feat(layer): Add cargo-clippy to Rust layer --- autoload/SpaceVim/layers/lang/rust.vim | 4 ++++ docs/layers/lang/rust.md | 1 + 2 files changed, 5 insertions(+) diff --git a/autoload/SpaceVim/layers/lang/rust.vim b/autoload/SpaceVim/layers/lang/rust.vim index 146f1d830..dce44d13b 100644 --- a/autoload/SpaceVim/layers/lang/rust.vim +++ b/autoload/SpaceVim/layers/lang/rust.vim @@ -70,6 +70,7 @@ " SPC l c B cargo-bench " SPC l c D cargo-docs " SPC l c r cargo-run +" SPC l c l cargo-clippy " < " " This layer also provides REPL support for rust, the key bindings are: @@ -182,6 +183,9 @@ function! s:language_specified_mappings() abort call SpaceVim#mapping#space#langSPC('nnoremap', ['l','c', 't'], 'call call(' \ . string(function('s:execCMD')) . ', ["cargo test"])', \ 'cargo-test', 1) + call SpaceVim#mapping#space#langSPC('nnoremap', ['l','c', 'l'], 'call call(' + \ . string(function('s:execCMD')) . ', ["cargo clippy"])', + \ 'cargo-clippy', 1) call SpaceVim#mapping#space#langSPC('nnoremap', ['l','c', 'u'], 'call call(' \ . string(function('s:execCMD')) . ', ["cargo update"])', \ 'update-external-dependencies', 1) diff --git a/docs/layers/lang/rust.md b/docs/layers/lang/rust.md index 68447ad01..e6ef827a5 100644 --- a/docs/layers/lang/rust.md +++ b/docs/layers/lang/rust.md @@ -77,6 +77,7 @@ To use this configuration layer, update your custom configuration file with: | `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.