<commit_before># *Racer* - code completion for [Rust](http://www.rust-lang.org/)

[![Build Status](https://travis-ci.org/phildawes/racer.svg?branch=master)](https://travis-ci.org/phildawes/racer)

![alt text](https://github.com/phildawes/racer/raw/master/images/racer1.png "Racer emacs session")

*RACER* = *R*ust *A*uto-*C*omplete-*er*. A utility intended to provide rust code completion for editors and IDEs. Maybe one day the 'er' bit will be exploring + refactoring or something.

## Installation

1. ```cd racer; cargo build --release```

2. Set the ```RUST_SRC_PATH``` env variable to point to the 'src' dir in your rust source installation

   (e.g. ```% export RUST_SRC_PATH=/usr/local/src/rust/src``` )

3. Test on the command line:

   ```./target/release/racer complete std::io::B ```  (should show some completions)


## Emacs integration

1. Install emacs 24

2. Install [rust-mode](https://github.com/rust-lang/rust-mode).

3. Install company mode. (e.g. via ELPA: ```M-x list-packages```, select ```'company'```)

4. Configure Emacs to find racer:

   ```
   (setq racer-rust-src-path "<path-to-rust-srcdir>/src/")
   (setq racer-cmd "<path-to-racer>/target/release/racer")
   (add-to-list 'load-path "<path-to-racer>/editors/emacs")
   (eval-after-load "rust-mode" '(require 'racer))
   ```

5. Configure Emacs to use racer.el:

   ```
   (add-to-list 'load-path "<path-to-racer>/editors/emacs")
   (require 'racer)
   (add-hook 'rust-mode-hook #'racer-activate)
   ```

6. You may wish to set up keybindings:

   ```
   (require 'rust-mode)
   (define-key rust-mode-map (kbd "TAB") #'racer-complete-or-indent)
   (define-key rust-mode-map (kbd "M-.") #'racer-find-definition)
   ```

7. Open a rust file and try typing ```use std::io::B``` and press \<tab\>

8. Place your cursor over a symbol and hit M-. to jump to the definition.

## Vim integration

1. Install using Pathogen, Vundle or NeoBundle. Or, copy racer/plugin/racer.vim into your .vim/plugin directory.

  Vundle users:<commit_msg>Fix emacs setup in README<commit_after># *Racer* - code completion for [Rust](http://www.rust-lang.org/)

[![Build Status](https://travis-ci.org/phildawes/racer.svg?branch=master)](https://travis-ci.org/phildawes/racer)

![alt text](https://github.com/phildawes/racer/raw/master/images/racer1.png "Racer emacs session")

*RACER* = *R*ust *A*uto-*C*omplete-*er*. A utility intended to provide rust code completion for editors and IDEs. Maybe one day the 'er' bit will be exploring + refactoring or something.

## Installation

1. ```cd racer; cargo build --release```

2. Set the ```RUST_SRC_PATH``` env variable to point to the 'src' dir in your rust source installation

   (e.g. ```% export RUST_SRC_PATH=/usr/local/src/rust/src``` )

3. Test on the command line:

   ```./target/release/racer complete std::io::B ```  (should show some completions)


## Emacs integration

1. Install emacs 24

2. Install [rust-mode](https://github.com/rust-lang/rust-mode).

3. Install company mode. (e.g. via ELPA: ```M-x list-packages```, select ```'company'```)

4. Configure Emacs to find racer:

   ```
   (setq racer-rust-src-path "<path-to-rust-srcdir>/src/")
   (setq racer-cmd "<path-to-racer>/target/release/racer")
   (add-to-list 'load-path "<path-to-racer>/editors/emacs")
   (eval-after-load "rust-mode" '(require 'racer))
   ```

5. Configure Emacs to activate racer and setup some key bindings when rust-mode starts:

   ```
   (add-hook 'rust-mode-hook 
	  '(lambda () 
	     (racer-activate)
	     (local-set-key (kbd "M-.") #'racer-find-definition)
	     (local-set-key (kbd "TAB") #'racer-complete-or-indent)))
   ```

7. Open a rust file and try typing ```use std::io::B``` and press \<tab\>

8. Place your cursor over a symbol and hit M-. to jump to the definition.

## Vim integration

1. Install using Pathogen, Vundle or NeoBundle. Or, copy racer/plugin/racer.vim into your .vim/plugin directory.

  Vundle users:
{'fraction_non_alphanumeric': 0.16916433832867667, 'fraction_numerical': 0.007366014732029464, 'mean_word_length': 3.6493506493506493, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1707229', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1407, 'n_words': 393}