Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rust autocomplete doesn't work in Vim

Tags:

vim

rust

vundle

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?

like image 678
soya666 Avatar asked May 12 '16 18:05

soya666


2 Answers

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

like image 198
malbarbo Avatar answered Sep 28 '22 04:09

malbarbo


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.
like image 25
AnthonyB Avatar answered Sep 28 '22 04:09

AnthonyB