From a762a32a0c65f93531b830c995f2213d004a8c85 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Wed, 4 Nov 2015 17:45:01 +1300 Subject: [PATCH] Add Vim reference to README and reorg --- README.md | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b79587a244c..1b8fd4dcffd 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,6 @@ A tool for formatting Rust code according to style guidelines. -## Gotchas - -* For things you do not want rustfmt to mangle, use one of - ```rust - #[rustfmt_skip] - #[cfg_attr(rustfmt, rustfmt_skip)] - ``` -* When you run rustfmt, place a file named rustfmt.toml in target file - directory or its parents to override the default settings of rustfmt. -* After successful compilation, a `rustfmt` executable can be found in the - target directory. ## Installation @@ -29,9 +18,15 @@ or if you're using [`multirust`](https://github.com/brson/multirust) multirust run nightly cargo install --git https://github.com/nrc/rustfmt ``` + +## Running Rustfmt from Vim + +See [instructions](http://johannh.me/blog/rustfmt-vim.html). + + ## How to build and test -First make sure you've got Rust **1.3.0** or greater available, then: +First make sure you've got Rust **1.4.0** or greater available, then: `cargo build` to build. @@ -50,3 +45,16 @@ the command line. `cargo run -- filename --write-mode=display` prints the output of rustfmt to the screen, for example. + + +## Gotchas + +* For things you do not want rustfmt to mangle, use one of + ```rust + #[rustfmt_skip] + #[cfg_attr(rustfmt, rustfmt_skip)] + ``` +* When you run rustfmt, place a file named rustfmt.toml in target file + directory or its parents to override the default settings of rustfmt. +* After successful compilation, a `rustfmt` executable can be found in the + target directory.