lang/rust: Differentiate doc building bindings

`cargo doc --open` (the previous binding of `SPC m b d`) always opens a
new browser tab. For "doc-driven development" this isn't so nice, since
we'd like to stay in the same tab and just refresh its contents after
editing. That's what `cargo doc` (without `--open`) does, which is
called by `#'rustic-carg-build-doc`.

This commit introduces a binding for the latter behaviour, but asigns it
to the old `SPC m b d`, with the "open" variant as `SPC m b D`. This
matches Spacemacs and follows the usual pattern of "the capital letter
variant is the one you use less often".
This commit is contained in:
Colin Woodbury 2021-05-26 21:57:05 -07:00
parent 68bee5043c
commit 4cb498e3a1
No known key found for this signature in database
GPG key ID: 101BA589276BB074

View file

@ -45,16 +45,17 @@
(map! :map rustic-mode-map (map! :map rustic-mode-map
:localleader :localleader
(:prefix ("b" . "build") (:prefix ("b" . "build")
:desc "cargo audit" "a" #'+rust/cargo-audit :desc "cargo audit" "a" #'+rust/cargo-audit
:desc "cargo build" "b" #'rustic-cargo-build :desc "cargo build" "b" #'rustic-cargo-build
:desc "cargo bench" "B" #'rustic-cargo-bench :desc "cargo bench" "B" #'rustic-cargo-bench
:desc "cargo check" "c" #'rustic-cargo-check :desc "cargo check" "c" #'rustic-cargo-check
:desc "cargo clippy" "C" #'rustic-cargo-clippy :desc "cargo clippy" "C" #'rustic-cargo-clippy
:desc "cargo doc" "d" #'rustic-cargo-doc :desc "cargo doc" "d" #'rustic-cargo-build-doc
:desc "cargo fmt" "f" #'rustic-cargo-fmt :desc "cargo doc --open" "D" #'rustic-cargo-doc
:desc "cargo new" "n" #'rustic-cargo-new :desc "cargo fmt" "f" #'rustic-cargo-fmt
:desc "cargo outdated" "o" #'rustic-cargo-outdated :desc "cargo new" "n" #'rustic-cargo-new
:desc "cargo run" "r" #'rustic-cargo-run) :desc "cargo outdated" "o" #'rustic-cargo-outdated
:desc "cargo run" "r" #'rustic-cargo-run)
(:prefix ("t" . "cargo test") (:prefix ("t" . "cargo test")
:desc "all" "a" #'rustic-cargo-test :desc "all" "a" #'rustic-cargo-test
:desc "current test" "t" #'rustic-cargo-current-test)) :desc "current test" "t" #'rustic-cargo-current-test))