2015-06-10 16:44:30 +00:00
#+TITLE : Rust contribution layer for Spacemacs
2015-11-08 18:04:44 +00:00
#+HTML_HEAD_EXTRA : <link rel="stylesheet" type="text/css" href="../../../css/readtheorg.css" />
2015-06-10 16:44:30 +00:00
[[file:img/rust.png ]]
2015-10-30 11:20:58 +00:00
* Table of Contents :TOC_4_org:noexport:
- [[Description ][Description ]]
- [[Install ][Install ]]
- [[Layer ][Layer ]]
- [[Cargo ][Cargo ]]
2016-01-03 13:32:03 +00:00
- [[Auto-completion ][Auto-completion ]]
2015-10-30 11:20:58 +00:00
- [[Key bindings ][Key bindings ]]
2015-06-10 16:44:30 +00:00
* Description
2015-07-01 05:37:31 +00:00
This layer aims to support [[http://www.rust-lang.org/ ][Rust ]] development in Spacemacs.
2015-06-10 16:44:30 +00:00
2015-07-01 05:37:31 +00:00
It supports [[http://doc.crates.io/index.html ][Cargo ]], and has some basic auto-completion support through [[https://github.com/phildawes/racer ][Racer ]],
though Racer needs some additional configurations as described on their page.
2015-06-10 16:44:30 +00:00
* Install
** Layer
To use this layer, add it to your =~/.spacemacs=
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(rust))
#+END_SRC
** Cargo
2015-06-10 21:16:01 +00:00
[[http://doc.crates.io/index.html ][Cargo ]] is a project management command line tool for Rust. Installation
instructions can be found on the main page of [[http://doc.crates.io/index.html ][Cargo ]].
2015-06-10 16:44:30 +00:00
2016-01-03 13:32:03 +00:00
** Auto-completion
To enable auto-completion, ensure that the =auto-completion= layer is enabled and
add the following line to your =dotspacemacs/user-init= :
2016-01-02 11:48:00 +00:00
#+BEGIN_SRC emacs-lisp
(setq-default rust-enable-racer t)
#+END_SRC
2016-01-03 13:32:03 +00:00
You have to install [[https://github.com/phildawes/racer ][Racer ]] to use this. For more information on the installation
procedure, look [[https://github.com/racer-rust/emacs-racer ][here ]].
2016-01-02 11:48:00 +00:00
2015-06-10 16:44:30 +00:00
* Key bindings
2015-06-16 08:27:54 +00:00
| Key Binding | Description |
|-------------+-----------------------------------|
| ~SPC m c c~ | compile project with Cargo |
| ~SPC m c t~ | run tests with Cargo |
| ~SPC m c d~ | generate documentation with Cargo |
2015-07-01 05:37:31 +00:00
| ~SPC m c x~ | execute the project with Cargo |
2015-09-15 05:28:15 +00:00
| ~SPC m c C~ | remove build artifacts with Cargo |