Ⅰ. 插件描述
Rust completion for Neovim (Deoplete) via RacerⅡ. 基本信息
|
Ⅲ. 安装方法
使用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
Ⅳ. 文档说明
Neovim/Deoplete auto-completion source for Rust
via Racer.
Auto-completion:
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 usewhich 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
Method | Action |
---|---|
DeopleteRustGoToDefinitionSplit | Open definition in horizontal split |
DeopleteRustGoToDefinitionVSplit | Open definition in vertical split |
DeopleteRustGoToDefinitionTab | Open 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.