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.

42 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. * `rust-analyzer` (Rust Language Server, required for `prelude-lsp` feature)
  11. ## Rust Mode
  12. Emacs comes with Rust programming support through the built-in
  13. `rust-mode`. Whenever you are editing Rust code run <kbd>C-h m</kbd> to
  14. look at the Rust mode key bindings.
  15. ## Syntax highlighting
  16. [tree-sitter-mode](https://emacs-tree-sitter.github.io/) is used for nicer
  17. syntax highlighting.
  18. ## Syntax checking
  19. Prelude ships with [Flycheck](https://github.com/flycheck/flycheck),
  20. an on the fly syntax checker. Flycheck has support for Rust. Rust is
  21. automatically setup in flycheck, by executing
  22. `flycheck-rust-setup`. If the current file is part of a Cargo project,
  23. flycheck is configured according to the Cargo project layout.
  24. ## Cargo integration
  25. Along with `rust-mode`, `cargo-minor-mode` is also configured. You can
  26. give cargo commands from inside the buffer to run cargo commands, like
  27. <kbd>C-c C-c C-b</kbd> for `cargo-process-build`, <kbd>C-c C-c
  28. C-t</kbd> for `cargo-process-test` and <kbd>C-c C-c C-r</kbd> for
  29. `cargo-process-run`