9

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?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
soya666
  • 361
  • 1
  • 4
  • 18

2 Answers2

7

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

malbarbo
  • 10,717
  • 1
  • 42
  • 57
4

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.
Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
Anthony
  • 2,014
  • 2
  • 19
  • 29
  • I installed this - after some struggling - but now when I do C-x C-o - I get the suggestions and the first one is inserted by default ... :O Which is super uncomfortable ... can we make the window appears and nothing is pre-selected? – pesho hristov Jan 29 '20 at 14:46