Rust autocomplete doesn't work in Vim
Asked Answered
T

2

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?

Testify answered 12/5, 2016 at 18:54 Comment(2)
More importantly, why do you expect autocompletion in the first place?Thence
@Thence Because it helps to keep the timeTestify
H
7

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

Highmuckamuck answered 12/5, 2016 at 19:4 Comment(0)
T
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.
Tapdance answered 20/7, 2018 at 13:49 Comment(1)
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?Skipbomb

© 2022 - 2024 — McMap. All rights reserved.