Rust completion with deoplete

This commit is contained in:
Julian Ospald 2018-06-15 22:05:00 +02:00
parent 9ebf392548
commit 282cea9bab
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
2 changed files with 16 additions and 7 deletions

View File

@ -1,5 +1,3 @@
let g:rustfmt_autosave = 0
let g:tagbar_ctags_bin = '/usr/bin/universal-ctags'
let g:rust_doc#define_map_K = 0
@ -15,13 +13,13 @@ function! s:search_under_cursor(query) range
endfunction
" keys
nnoremap <buffer><silent><F6> :<C-u>call <SID>search_under_cursor(expand('<cword>'))<CR>
vnoremap <buffer><silent><F6> "gy:call <SID>search_under_cursor(getreg('g'))<CR>
nnoremap <buffer><silent><F7> :<C-u>call <SID>search_under_cursor(expand('<cword>'))<CR>
vnoremap <buffer><silent><F7> "gy:call <SID>search_under_cursor(getreg('g'))<CR>
nnoremap <F3> :call LanguageClient_contextMenu()<CR>
nnoremap <silent> <F4> :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> <F7> :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> <F6> :call LanguageClient#textDocument_rename()<CR>
nnoremap <silent> <F6> :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> <F8> :call LanguageClient#textDocument_rename()<CR>
let g:LanguageClient_autoStart = 1
@ -29,7 +27,18 @@ let g:LanguageClient_autoStart = 1
let g:LanguageClient_serverCommands = {
\ 'rust': ['rustup', 'run', 'nightly', 'rls'] }
let g:LanguageClient_diagnosticsEnable = 0
let g:ale_linters = {'rust': ['rls']}
let g:ale_fixers = { 'rust': ['rustfmt'] }
let g:ale_fix_on_save = 0
let g:autofmt_autosave = 0
" deoplete
call deoplete#custom#option('sources',{
\ '_': ['buffer'],
\ 'rust': ['ultisnips', 'buffer', 'file', 'LanguageClient']
\ })
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
call deoplete#enable()

2
vimrc
View File

@ -59,7 +59,7 @@ Plug 'LucHermitte/local_vimrc'
" completion
Plug 'Valloric/YouCompleteMe', { 'do': './install.py --clang-completer --go-completer --rust-completer --system-boost --system-libclang',
\ 'for': ['c', 'python', 'sh', 'go', 'clojure', 'rust'],
\ 'for': ['c', 'python', 'sh', 'go', 'clojure'],
\ }
" deoplete for haskell
if has('nvim')