Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Apr 4, 2021
1 parent c7f5ec4 commit ebbcb28
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

This plugin allows vim to use [Racer](http://github.com/phildawes/racer) for Rust code completion and navigation.

**Note**: Active development on vim-racer has stopped. The only future changes
will be bug fixes. You should use LSP plugins(vim-lsp, nvim-lspconfig)
instead.


## Installation

1. Build / Install [Racer](http://github.com/phildawes/racer)

2. Install using Pathogen, Vundle or NeoBundle. Or, copy `ftplugin/rust_racer.vim` into your `~/.vim/plugin` directory.
2. Install using Pathogen, Vundle or NeoBundle. Or, copy
`ftplugin/rust_racer.vim` into your `~/.vim/plugin` directory.

Vundle users:
```
Expand All @@ -28,15 +34,21 @@ This plugin allows vim to use [Racer](http://github.com/phildawes/racer) for Rus
git clone --depth=1 https://github.com/racer-rust/vim-racer.git ~/.vim/bundle/vim-racer
```

3. Add `g:racer_cmd` to your `.vimrc`. It contains full path to `racer` executable file.
Variable `g:racer_cmd` is optional. You do not need to use this variable if the executable file is in a directory that is specified in `$PATH`, else you should specified full path to `racer` executable binary file in this `g:racer_cmd`. Also it's worth turning on 'hidden' mode for buffers otherwise you need to save the current buffer every time you do a goto-definition. E.g.:
3. Add `g:racer_cmd` to your `.vimrc`. It contains full path to `racer`
executable file. Variable `g:racer_cmd` is optional. You do not need to use
this variable if the executable file is in a directory that is specified in
`$PATH`, else you should specified full path to `racer` executable binary
file in this `g:racer_cmd`. Also it's worth turning on 'hidden' mode for
buffers otherwise you need to save the current buffer every time you do a
goto-definition. E.g.:

```
set hidden
let g:racer_cmd = "/home/user/.cargo/bin/racer"
```

4. If you want completions to show the complete function definition (e.g. its arguments and return type), enable the experimental completer:
4. If you want completions to show the complete function definition (e.g. its
arguments and return type), enable the experimental completer:

```
let g:racer_experimental_completer = 1
Expand All @@ -53,11 +65,11 @@ Variable `g:racer_cmd` is optional. You do not need to use this variable if the
vim-racer enables `C-x-C-o` to search for completions and provides several
`<Plug>` mappings for source code navigation. These mappings are not enabled by
default but you can easily use them by adding the following lines to your
`.vimrc` (Or `init.vim` in case of Neovim).
`.vimrc` (Or `init.vim` in case of Neovim).

For example, with the following mappings you can navigate to the identifier under
the cursor and open it on the current buffer, on an horizontal or vertical split, on a new tab,
or go straight to the documentation:
For example, with the following mappings you can navigate to the identifier
under the cursor and open it on the current buffer, on an horizontal or
vertical split, on a new tab, or go straight to the documentation:

```
augroup Racer
Expand Down

0 comments on commit ebbcb28

Please sign in to comment.