Skip to content

Latest commit

 

History

History
120 lines (98 loc) · 3.69 KB

README.md

File metadata and controls

120 lines (98 loc) · 3.69 KB

Rust TextMate2 Bundle

A TextMate Bundle for the Rust programming language.

Installation

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:

Initial installation

gem install tmbundle-manager
tmb install carols10cents/rust

Updating

tmb update rust

Current Features:

  • 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)

How to enable autocompletion via racer

  • 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 set CARGO_INSTALL_ROOT in TextMate)
    • $CARGO_HOME/bin (if you have set CARGO_HOME in TextMate)
    • $HOME/.cargo/bin
  • If you want your racer binary to be somewhere other than the locations in the last step, set the TM_RACER variable in your TextMate preferences to the location of your racer 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).

Support for cross compilation:

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.

Future Features:

  • Improved Syntax Highlighting
  • Block folding of functions
  • File an issue if you have more ideas!

License

This bundle is licensed under the MIT License (LICENSE).