LunarVim/modules/deoplete.vim

37 lines
1.2 KiB
VimL
Raw Normal View History

" Enable deoplete
2019-02-11 01:58:26 +01:00
let g:deoplete#enable_at_startup = 1
let g:deoplete#complete_method = "omnifunc"
let g:deoplete#auto_complete_delay = 0
2019-02-17 20:10:04 +01:00
""let g:deoplete#max_menu_width = 10
2019-02-14 03:22:58 +01:00
" let g:deoplete#ignore_sources = ['buffer']
2019-02-17 20:10:04 +01:00
"
" Close previews immediately
autocmd CompleteDone * silent! pclose!
"
2019-02-16 17:44:35 +01:00
"better nav for omnicomplete
inoremap <expr> <c-j> ("\<C-n>")
inoremap <expr> <c-k> ("\<C-p>")
"<TAB>: completion.
""inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
"use TAB as the mapping
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ deoplete#mappings#manual_complete()
function! s:check_back_space() abort ""
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction ""
inoremap <silent><expr><S-TAB> pumvisible() ? "\<C-p>" : "\<TAB>"
inoremap <expr><BS> deoplete#smart_close_popup()."\<C-h>"
2019-02-17 20:10:04 +01:00
call deoplete#custom#option('sources', {
\ 'python': ['file', 'LanguageClient', 'neosnippet'],
\ })
" Sort matches alphabetically
call deoplete#custom#source('_', 'sorters', ['sorter_word'])
" Disable shorter or equal length matches
call deoplete#custom#source('_', 'matchers', ['matcher_fuzzy', 'matcher_length'])