Deoplete.nvim: How to config to use <TAB> key for completion

Created on 31 Jul 2018  路  6Comments  路  Source: Shougo/deoplete.nvim

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

Just updated to Vim 8 and switched from neocomplete to deoplete.
I get used to key for completion, is there anyway we can config in deoplete?

Expected

config to use key for completion

Most helpful comment

problem sorted:

" <TAB>: completion.
inoremap <expr><TAB>  pumvisible() ? "\<C-n>" : "\<TAB>"

All 6 comments

problem sorted:

" <TAB>: completion.
inoremap <expr><TAB>  pumvisible() ? "\<C-n>" : "\<TAB>"

my setting

function! s:check_back_space() abort "{{{
  let col = col('.') - 1
  return !col || getline('.')[col - 1]  =~ '\s'
endfunction"}}}
inoremap <silent><expr> <TAB>
      \ pumvisible() ? "\<C-n>" :
      \ <SID>check_back_space() ? "\<TAB>" :
      \ deoplete#manual_complete()

It should be a simple option...

Some plugin defines the mapping. But the auto completion plugin should not define it.
Because, the best mapping depends on users configuration.

And deoplete is not plugin for beginners.

Thanks for the snippets. I have tried both and both work but only after re-sourceing my .vimrc. I'm not sure why this is necessary. I do not map Tab for insert mode anywhere else in my settings.

You should check the mapping.

:verbose imap <Tab>

I think other plugin overwrites your mapping.

Was this page helpful?
0 / 5 - 0 ratings