Skip to content

Commit

Permalink
lang/rust: Differentiate doc building bindings
Browse files Browse the repository at this point in the history
`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".
  • Loading branch information
fosskers committed May 27, 2021
1 parent 68bee50 commit 4cb498e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions modules/lang/rust/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@
(map! :map rustic-mode-map
:localleader
(:prefix ("b" . "build")
:desc "cargo audit" "a" #'+rust/cargo-audit
:desc "cargo build" "b" #'rustic-cargo-build
:desc "cargo bench" "B" #'rustic-cargo-bench
:desc "cargo check" "c" #'rustic-cargo-check
:desc "cargo clippy" "C" #'rustic-cargo-clippy
:desc "cargo doc" "d" #'rustic-cargo-doc
:desc "cargo fmt" "f" #'rustic-cargo-fmt
:desc "cargo new" "n" #'rustic-cargo-new
:desc "cargo outdated" "o" #'rustic-cargo-outdated
:desc "cargo run" "r" #'rustic-cargo-run)
:desc "cargo audit" "a" #'+rust/cargo-audit
:desc "cargo build" "b" #'rustic-cargo-build
:desc "cargo bench" "B" #'rustic-cargo-bench
:desc "cargo check" "c" #'rustic-cargo-check
:desc "cargo clippy" "C" #'rustic-cargo-clippy
:desc "cargo doc" "d" #'rustic-cargo-build-doc
:desc "cargo doc --open" "D" #'rustic-cargo-doc
:desc "cargo fmt" "f" #'rustic-cargo-fmt
:desc "cargo new" "n" #'rustic-cargo-new
:desc "cargo outdated" "o" #'rustic-cargo-outdated
:desc "cargo run" "r" #'rustic-cargo-run)
(:prefix ("t" . "cargo test")
:desc "all" "a" #'rustic-cargo-test
:desc "current test" "t" #'rustic-cargo-current-test))
Expand Down

0 comments on commit 4cb498e

Please sign in to comment.