Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/racer-rust/vim-racer
Racer support for Vim
https://github.com/racer-rust/vim-racer
Last synced: 10 days ago
JSON representation
Racer support for Vim
- Host: GitHub
- URL: https://github.com/racer-rust/vim-racer
- Owner: racer-rust
- License: mit
- Created: 2015-09-15T15:38:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-04-04T01:56:30.000Z (almost 4 years ago)
- Last Synced: 2024-10-27T23:24:51.302Z (4 months ago)
- Language: Vim script
- Size: 123 KB
- Stars: 632
- Watchers: 10
- Forks: 43
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
- awesome-rust-cn - vim-racer - rust/racer) for Rust code completion and navigation. (Development tools / IDEs)
- awesome-rust - vim-racer - rust/racer) for Rust code completion and navigation. (Development tools / IDEs)
- awesome-rust - vim-racer - rust/racer) for Rust code completion and navigation. (Development tools / IDEs)
- awesome-rust-cn - vim-racer - rust/racer) (开发工具 Development tools / 编译器 IDEs)
- awesome-rust-zh - vim-racer - 允许 vim 使用[Racer](https://github.com/racer-rust/racer)用于 Rust 代码完成和导航。 (开发工具 / 集成开发环境(IDE))
- awesome-rust - vim-racer - allows vim to use [Racer](https://github.com/racer-rust/racer) for Rust code completion and navigation. (Development tools / IDEs)
- awesome-rust - vim-racer - rust/racer) for Rust code completion and navigation. (开发工具 Development tools / 编辑器 IDEs)
- fucking-awesome-rust - vim-racer - allows vim to use <b><code> 3358⭐</code></b> <b><code> 279🍴</code></b> [Racer](https://github.com/racer-rust/racer)) for Rust code completion and navigation. (Development tools / IDEs)
- fucking-awesome-rust - vim-racer - allows vim to use <b><code> 3358⭐</code></b> <b><code> 278🍴</code></b> [Racer](https://github.com/racer-rust/racer)) for Rust code completion and navigation. (Development tools / IDEs)
README
# Vim Racer Plugin
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.Vundle users:
```
Plugin 'racer-rust/vim-racer'
```NeoBundle users:
```
NeoBundle 'racer-rust/vim-racer'
```vim-plug users:
```
Plug 'racer-rust/vim-racer'
```Pathogen users:
```
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.:```
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:```
let g:racer_experimental_completer = 1
```5. If you want to insert the parenthesis in the completion:
```
let g:racer_insert_paren = 1
```## Example Mappings
vim-racer enables `C-x-C-o` to search for completions and provides several
`` 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).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
autocmd!
autocmd FileType rust nmap gd (rust-def)
autocmd FileType rust nmap gs (rust-def-split)
autocmd FileType rust nmap gx (rust-def-vertical)
autocmd FileType rust nmap gt (rust-def-tab)
autocmd FileType rust nmap gd (rust-doc)
autocmd FileType rust nmap gD (rust-doc-tab)
augroup END
```