dotfiles/config/automatrop/roles/vim/templates/plugins/deoplete.j2

27 lines
784 B
Plaintext
Raw Permalink Normal View History

2021-07-03 14:13:25 +02:00
{# Auto-completion for vim and nvim #}
{% if variant == 'nvim' -%}
{{ add_source('Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'}) -}}
{% else -%}
{{ add_source('Shougo/deoplete.nvim') -}}
{{ add_source('roxma/nvim-yarp') -}}
{{ add_source('roxma/vim-hug-neovim-rpc') -}}
{% endif -%}
{% raw %}
let g:deoplete#enable_at_startup = 1
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ deoplete#manual_complete()
function! s:check_back_space() abort "{{{
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction"}}}
{% endraw %}
" suggested by ssemshi to make it not too slow
" let g:deoplete#auto_complete_delay = 100
call deoplete#custom#option({
\ 'auto_complete_delay': 100,
\ 'smart_case': v:true,
\ })