25 lines
733 B
VimL
25 lines
733 B
VimL
let g:deoplete#enable_at_startup = 1
|
|
if !exists('g:deoplete#omni#input_patterns')
|
|
let g:deoplete#omni#input_patterns = {}
|
|
endif
|
|
|
|
" <C-h>, <BS>: close popup and delete backword char.
|
|
inoremap <expr><C-h> deoplete#smart_close_popup()."\<C-h>"
|
|
inoremap <expr><BS> deoplete#smart_close_popup()."\<C-h>"
|
|
|
|
" <CR>: close popup and save indent.
|
|
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
|
|
function! s:my_cr_function() abort
|
|
return deoplete#close_popup() . "\<CR>"
|
|
endfunction
|
|
|
|
inoremap <silent><expr> <TAB>
|
|
\ pumvisible() ? "\<C-n>" :
|
|
\ <SID>check_back_space() ? "\<TAB>" :
|
|
\ "\<C-x><C-o>"
|
|
|
|
function! s:check_back_space()
|
|
let col = col('.') - 1
|
|
return !col || getline('.')[col - 1] =~ '\s'
|
|
endfunction
|