Neovim/Deoplete auto-completion source for Rust via Racer.
cargo install racer
git clone https://github.com/phildawes/racer.git; cd racer
cargo build --release
Copy binary to ./target/release/racer
to a location of your choice.
(e.g. to /usr/local/bin
)
mkdir -p choose/a/path
git clone --depth=1 https://github.com/rust-lang/rust.git
For details see the installation guide
Plug 'sebastianmarkow/deoplete-rust'
Plugin 'sebastianmarkow/deoplete-rust'
NeoBundle 'sebastianmarkow/deoplete-rust'
git clone --depth=1 https://github.com/sebastianmarkow/deoplete-rust.git path/to/vim/bundle/deoplete-rust
Set fully qualified path to racer
binary. If it is in your PATH
already use
which racer
. (required)
let g:deoplete#sources#rust#racer_binary='/path/to/racer'
Set Rust source code path (when cloning from Github usually ending on /src
).
(required)
let g:deoplete#sources#rust#rust_source_path='/path/to/rust/src'
Show duplicate matches.
let g:deoplete#sources#rust#show_duplicates=1
To disable default key mappings (gd
& K
) add the following
let g:deoplete#sources#rust#disable_keymap=1
Set max height of documentation split.
let g:deoplete#sources#rust#documentation_max_height=20
These are the default key mappings
nmap <buffer> gd <plug>DeopleteRustGoToDefinitionDefault
nmap <buffer> K <plug>DeopleteRustShowDocumentation
Additional methods to bind
Method | Action |
---|---|
DeopleteRustGoToDefinitionSplit |
Open definition in horizontal split |
DeopleteRustGoToDefinitionVSplit |
Open definition in vertical split |
DeopleteRustGoToDefinitionTab |
Open definition in new tab |
Jump to definition of the current element under the cursor.
Show brief description of the current element under the cursor.
To close press either q
, cr
or esc
.
You don't have to remember it all. Run :help deoplete-rust
.
deoplete-rust is licensed under MIT License.
For additional information, see LICENSE
file.