Emacs config utilizing prelude as a base
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.3 KiB

  1. # Prelude Rust
  2. !!! Note
  3. This module builds on top of the shared [Programming](programming.md) module.
  4. ## Package Prerequisites
  5. For the proper functioning of this module, you'll need to install the
  6. following packages in your system:
  7. * `rustc` (Rust compiler)
  8. * `cargo` (Rust package manager)
  9. * `rustfmt` (Rust tool for formatting code)
  10. * `racer` (Rust completion tool, not necessary if `prelude-lsp` is enabled)
  11. * `rls` (Rust Language Server, if the `prelude-lsp` feature is enabled)
  12. ## Rust Mode
  13. Emacs comes with Rust programming support through the built-in
  14. `rust-mode`. Whenever you are editing Rust code run <kbd>C-h m</kbd> to
  15. look at the Rust mode key bindings.
  16. ## Syntax checking
  17. Prelude ships with [Flycheck](https://github.com/flycheck/flycheck),
  18. an on the fly syntax checker. Flycheck has support for Rust. Rust is
  19. automatically setup in flycheck, by executing
  20. `flycheck-rust-setup`. If the current file is part of a Cargo project,
  21. flycheck is configured according to the Cargo project layout.
  22. ## Cargo integration
  23. Along with `rust-mode`, `cargo-minor-mode` is also configured. You can
  24. give cargo commands from inside the buffer to run cargo commands, like
  25. <kbd>C-c C-c C-b</kbd> for `cargo-process-build`, <kbd>C-c C-c
  26. C-t</kbd> for `cargo-process-test` and <kbd>C-c C-c C-r</kbd> for
  27. `cargo-process-run`