Skip to content

Commit 3fd6570

Browse files
Add better documentation to commands
1 parent 5b91d05 commit 3fd6570

File tree

2 files changed

+43
-10
lines changed

2 files changed

+43
-10
lines changed

README.md

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,40 @@ to Cargo.toml by checking new diagnostics for 'unresolved import' errors
531531
- `rustic-cargo-use-last-stored-arguments` always use stored arguments that were provided with `C-u`(instead of requiring to run rustic "rerun" commands)
532532
- `rustic-cargo-populate-package-name` for auto populating the correct package name when used with universal argument. This comes in handy when you are working with multiple projects. Not enabled by default, but recommened to enable it.
533533

534+
535+
### Keybindings
536+
537+
Note that most commands support editing the exact `cargo` arguments and flags when called with the
538+
prefix `C-u`.
539+
540+
Keybinding | Command
541+
------------------------|----------------------
542+
<kdb>C-c C-p</kdb> | rustic-popup
543+
<kdb>C-c C-c C-u</kdb> | rustic-compile
544+
<kdb>C-c C-c C-i</kdb> | rustic-recompile
545+
<kdb>C-c C-c C-o</kdb> | rustic-format-buffer
546+
<kdb>C-c C-c C-,</kdb> | rustic-docstring-dwim
547+
<kdb>C-c C-c C-b</kdb> | rustic-cargo-build
548+
<kdb>C-c C-c C-k</kdb> | rustic-cargo-check
549+
<kdb>C-c C-c C-r</kdb> | rustic-cargo-run
550+
<kdb>C-c C-c C-f</kdb> | rustic-cargo-fmt
551+
<kdb>C-c C-c C-t</kdb> | rustic-cargo-test
552+
<kdb>C-c C-c C-c</kdb> | rustic-cargo-current-test
553+
<kdb>C-c C-c C-l</kdb> | rustic-cargo-clippy
554+
<kdb>C-c C-c C-n</kdb> | rustic-cargo-outdated
555+
<kdb>C-c C-c n</kdb> | rustic-cargo-new
556+
<kdb>C-c C-c i</kdb> | rustic-cargo-init
557+
<kdb>C-c C-c b</kdb> | rustic-cargo-bench
558+
<kdb>C-c C-c d</kdb> | rustic-cargo-doc
559+
<kdb>C-c C-c c</kdb> | rustic-cargo-clean
560+
<kdb>C-c C-c k</kdb> | rustic-cargo-clippy
561+
<kdb>C-c C-c f</kdb> | rustic-cargo-clippy-fix
562+
<kdb>C-c C-c a</kdb> | rustic-cargo-add
563+
<kdb>C-c C-c r</kdb> | rustic-cargo-rm
564+
<kdb>C-c C-c u</kdb> | rustic-cargo-upgrade
565+
566+
More details on each command below
567+
534568
### Edit
535569

536570
[cargo-edit](https://github.com/killercup/cargo-edit) provides commands to edit
@@ -551,17 +585,15 @@ If you want to disable warnings when running cargo-test commands, you can set
551585

552586
Commands:
553587

554-
- `rustic-cargo-test` run 'cargo test', when called with `C-u` store
555-
arguments in `rustic-test-arguments`
556-
- `rustic-cargo-test-rerun` rerun 'cargo test' with arguments stored
557-
in `rustic-test-arguments`
558-
- `rustic-cargo-current-test` run test at point, whether it's a
559-
function or a module
588+
- `rustic-cargo-test` run 'cargo test', when called with `C-u` edit the command
589+
before running and store in `rustic-test-arguments`.
590+
- `rustic-cargo-test-rerun` (`g` from compile buffer) rerun 'cargo test' with arguments stored in
591+
`rustic-test-arguments`
592+
- `rustic-cargo-current-test` run test at point, whether it's a function or a module
593+
- `rustic-cargo-test-rerun-current` (`C-c C-t` or `t` from compile buffer) re-run the test at point
594+
from the `*cargo-test*` compile buffer.
560595
- `rustic-cargo-run-nextest` command for running [nextest](https://github.com/nextest-rs/nextest)
561-
- `rustic-cargo-nextest-current-test` is the nextest equivalent for
562-
`rustic-cargo-current-test`
563-
- `rustic-cargo-test-rerun-current` re-run the test at point from the
564-
`*cargo-test*` compile buffer. (bound to `C-c C-t`)
596+
- `rustic-cargo-nextest-current-test` is the nextest equivalent for `rustic-cargo-current-test`
565597

566598
![](https://raw.githubusercontent.com/emacs-rustic/rustic/main/img/cargo_current_test.png)
567599

rustic-cargo.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ stored in this variable.")
178178
(set-keymap-parent map rustic-compilation-mode-map)
179179
(define-key map [remap recompile] 'rustic-cargo-test-rerun)
180180
(define-key map (kbd "C-c C-t") 'rustic-cargo-test-rerun-current)
181+
(define-key map (kdb "t") 'rustic-cargo-test-rerun-current)
181182
map)
182183
"Local keymap for `rustic-cargo-test-mode' buffers.")
183184

0 commit comments

Comments
 (0)