A TextMate Bundle for the Rust programming language.
Without any extra dependencies:
- Download either the zip or tar
- Decompress
- Rename the subdirectory rust_tmbundle to rust.tmbundle
- Double click on rust.tmbundle to install in TextMate
If you'd like, and assuming you don't mind using Ruby, you can use the ruby gem
tmbundle-manager
to makes managing and updating yourtextmate bundles easier:
gem install tmbundle-manager
tmb install carols10cents/rust
tmb update rust
- Basic Syntax Highlighting
- Code Snippets
- Commands (Note the cargo commands will only work in TextMate Nightly until textmate/textmate#1305 is released):
In order to: | Shortcut: |
---|---|
Run current file | cmd + shift + r, then 1 |
Build current file | cmd + shift + r, then 2 |
Build current file with tests | cmd + shift + r, then 3 |
Run current file's tests | cmd + shift + r, then 4 |
When a `Cargo.toml` is present in the root: | |
Cargo run current project | cmd + r, then 1 |
Cargo build current project | cmd + r, then 2 |
Cargo check current project | cmd + r, then 3 |
Cargo test current project | cmd + r, then 4 |
Cargo fmt current project (if `cargo fmt` is installed) | cmd + r, then 5 |
Cargo clippy current project (if `cargo clippy` is installed) | cmd + r, then 6 |
- Autocompletion when racer is available (see instructions below)
- Install racer by following the instructions in racer's README
- The textmate bundle will look in the following locations first for a
racer
binary, so either move or symlink[racer checkout directory]/target/release/racer
into one of these locations:/usr/local/bin
/opt/local/bin
$CARGO_INSTALL_ROOT/bin
(if you have setCARGO_INSTALL_ROOT
in TextMate)$CARGO_HOME/bin
(if you have setCARGO_HOME
in TextMate)$HOME/.cargo/bin
- If you want your
racer
binary to be somewhere other than the locations in the last step, set theTM_RACER
variable in your TextMate preferences to the ___location of yourracer
binary. - Set the
RUST_SRC_PATH
variable in your TextMate preferences to the ___location of your Rust source directory (the same ___location that you set this variable to as part of the racer installation instructions).
So that this bundle can be used when cross compiling for Fuchsia, the TM_CARGO_NAME
and TM_CARGO_PARAMS
environmental variables can be used to cause the bundle to emit fargo cargo -- check
instead of cargo check
, for example. This could be extended to support other tools like
xargo if there's any interest.
- Improved Syntax Highlighting
- Block folding of functions
- File an issue if you have more ideas!
This bundle is licensed under the MIT License (LICENSE).
- Copyright (c) 2012 Tom Ellis
- Copyright (c) 2014 Elia Schito
- Copyright (c) 2015 Carol (Nichols || Goulding)
- Copyright (c) 2017 Google Inc