nvim: init.vim: Improve deoplete bindings

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2019-09-24 20:45:37 +05:30
parent 324fcdd113
commit 2ad25de443
1 changed files with 26 additions and 0 deletions

View File

@ -193,6 +193,7 @@ let g:LanguageClient_rootMarkers = ['stack.yaml']
let g:LanguageClient_serverCommands = {
\ 'haskell': ['$HOME/.local/bin/hie-wrapper'],
\ 'go' : ['$HOME/go/bin/gopls'],
\ 'clojure': ['bash', '-c', 'clojure-lsp'],
\ }
nnoremap <Leader>ld :call LanguageClient#textDocument_definition()<CR>
@ -314,8 +315,33 @@ let g:intero_vertical_split = 1
" OPTIONAL: Make the update time shorter, so the type info will trigger faster.
set updatetime=1000
augroup deopleteMaps
au!
" For deoplete Rust
au FileType rust nmap <buffer> <Leader>rd <plug>DeopleteRustGoToDefinitionDefault
au FileType rust nmap <buffer> <Leader>rc <plug>DeopleteRustShowDocumentation
au FileType rust nmap <buffer> <Leader>rv <plug>DeopleteRustGoToDefinitionVSplit
au FileType rust nmap <buffer> <Leader>rh <plug>DeopleteRustGoToDefinitionSplit
au FileType rust nmap <buffer> <Leader>rt <plug>DeopleteRustGoToDefinitionTab
augroup END
" Use deoplete
let g:deoplete#enable_at_startup = 1
" Disable autocomplete by default
" let b:deoplete_disable_auto_complete = 1
" let g:deoplete_disable_auto_complete = 1
" Let sources be empty by default
let g:deoplete#sources = {}
" Disable the candidates in Comment/String syntaxes.
call deoplete#custom#source('_',
\ 'disabled_syntaxes', ['Comment', 'String'])
call deoplete#custom#option('sources', {
\ 'rust': ['racer'],
\ 'haskell': ['LanguageClient'],
\ 'go': ['LanguageClient'],
\ 'clojure': ['LanguageClient'],
\})
let g:deoplete#sources#rust#disable_keymap = 1
let g:deoplete#sources#rust#racer_binary='/home/sanchayan/.cargo/bin/racer'
let g:deoplete#sources#rust#rust_source_path='/home/sanchayan/GitSources/rust/src'