deoplete-rust


Ⅰ. 插件描述

Rust completion for Neovim (Deoplete) via Racer

Ⅱ. 基本信息

创建日期:  2016-07-08
使用用户:  65
Github星:  122
插件作者:  Sebastian Klatt

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'sebastianmarkow/deoplete-rust'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'sebastianmarkow/deoplete-rust'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'sebastianmarkow/deoplete-rust'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/sebastianmarkow/deoplete-rust

Ⅳ. 文档说明

# deoplete-rust Gitter

Neovim/Deoplete auto-completion source for Rust
via Racer.

Auto-completion:
Screenshot auto-completion

Documentation:
Screenshot documentation

Requirements

Install Racer

with cargo

cargo install racer

from source

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)

Get Rust source code

mkdir -p choose/a/path
git clone --depth=1 https://github.com/rust-lang/rust.git

Install Deoplete

For details see the installation guide

Installation

with vim-plug

Plug 'sebastianmarkow/deoplete-rust'

with Vundle

Plugin 'sebastianmarkow/deoplete-rust'

with NeoBundle

NeoBundle 'sebastianmarkow/deoplete-rust'

with Pathogen

git clone --depth=1 https://github.com/sebastianmarkow/deoplete-rust.git path/to/vim/bundle/deoplete-rust

Configuration (init.vim)

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

Usage

Default key mappings

These are the default key mappings

nmap <buffer> gd <plug>DeopleteRustGoToDefinitionDefault
nmap <buffer> K  <plug>DeopleteRustShowDocumentation

Additional methods to bind

MethodAction
DeopleteRustGoToDefinitionSplitOpen definition in horizontal split
DeopleteRustGoToDefinitionVSplitOpen definition in vertical split
DeopleteRustGoToDefinitionTabOpen definition in new tab

gd Go to definition

Jump to definition of the current element under the cursor.

K Show documentation

Show brief description of the current element under the cursor.
To close press either q, cr or esc.

Show help

You don't have to remember it all. Run :help deoplete-rust.

License

deoplete-rust is licensed under MIT License.
For additional information, see LICENSE file.

添加新评论