Cargo mode for Emacs. This package gives you a set of key combinations to perform Cargo tasks within your Rust projects.
This package can be installed through melpa:
M-x package-install cargo
Add cargo-minor-mode to your rust-mode-hook
(add-hook 'rust-mode-hook 'cargo-minor-mode)
You will now have the following key combinations at your disposal:
Keybinding | Command |
---|---|
C-c C-c C-e | cargo-process-bench |
C-c C-c C-b | cargo-process-build |
C-c C-c C-l | cargo-process-clean |
C-c C-c C-d | cargo-process-doc |
C-c C-c C-n | cargo-process-new |
C-c C-c C-i | cargo-process-init |
C-c C-c C-r | cargo-process-run |
C-c C-c C-x | cargo-process-run-example |
C-c C-c C-s | cargo-process-search |
C-c C-c C-t | cargo-process-test |
C-c C-c C-u | cargo-process-update |
C-c C-c C-c | cargo-process-repeat |
C-c C-c C-f | cargo-process-current-test |
C-c C-c C-o | cargo-process-current-file-tests |
Before executing the task, Emacs will prompt you to save any modified buffers
associated with the current Cargo project. Setting compilation-ask-about-save
to nil
makes Emacs save modified buffers without asking.