9
votes

I installed Rust and the Rust vim plugin, but autocomplete does not work.

  • I'm using a nightly version of Rust (rustc 1.10.0-dev (992bb1332 2016-05-12).
  • I used Vundle to install the plugin
  • I'm running Debian GNU/Linux sid

.vimrc

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'
Plugin 'mattn/vim-particle'
Plugin 'davidhalter/jedi-vim'
Plugin 'rust-lang/rust.vim'

call vundle#end()            " required
filetype plugin indent on    " required

Why is autocomplete not working?

2
More importantly, why do you expect autocompletion in the first place?romainl
@romainl Because it helps to keep the timesoya666

2 Answers

7
votes

The Rust vim plugin doesn't support autocomplete. YouCompleteMe has autocomplete for Rust (powered by racer).

4
votes

YouCompleteMe is a bit complicated to install and heavy, but is probably great if you have many languages you want to autocomplete. In my case, VimRacer really does the job!

Here's how to install it:

  1. Install Racer.
  2. Execute rustup component add rust-src to get the Rust source code.
  3. Install VimRacer using the way you prefer (Vundle or other) and follow the README.