Deoplete.nvim: Navigate through suggestions is not adding them

Created on 6 Apr 2016  ·  10Comments  ·  Source: Shougo/deoplete.nvim

Problems summary

Watching your gif in the README page I can see that when you navigate through complete suggestions, the code is updated with the suggestion. To me, it does not work that way. It just appears in code when I press Enter.

Environment Information

  • OS: Arch Linux
  • Neovim version: v0.1.3-364-gae68609

    Provide a minimal init.vim with less than 50 lines (Required!)

" Your minimal init.vim
set runtimepath+=~/path/to/deoplete.nvim/
let g:deoplete#enable_at_startup = 1
call plug#begin('~/.vim/plugged')
    Plug 'Shougo/deoplete.nvim'
call plug#end()

filetype plugin indent on
color matrix

The reproduce ways from neovim starting (Required!)

  1. start neovim
  2. write "aaaaaaaaaaaaaa"
  3. in next line, write "aaa"
  4. a window appears suggesting "aaaaaaaaaaaaaaaaaaa"
  5. press down_arrow key to select "aaaaaaaaaaaaaaaaaaa"
  6. it should update my text accordingly, but it doesn't
  7. pressing enter, the text is updated.
question

Most helpful comment

Perhaps you should consult a Health Care professional.

Hahaha, really?

When the autocomplete options show up, I would like to use <C-j> to move down the list of options (as opposed to <C-n>). I would like to use <C-k> to move back up the list of options (as opposed to <C-p>) . To insert the selected option I would like to be able to use <C-l> (that is still an “L”).

It is very clear answer. I understand.
I have known your configuration seems wrong.
But I cannot understand your desired behavior from your previous comment.
https://github.com/Shougo/deoplete.nvim/issues/246#issuecomment-343627162

The solution is here.

inoremap <expr><C-j> pumvisible() ? "\<C-n>" : "\<Down>"
inoremap <expr><C-k> pumvisible() ? "\<C-p>" : "\<Up>"
inoremap <expr><C-l> pumvisible() ? "\<C-y>" : "\<C-l>"

All 10 comments

@eduardoHoefel Hi,
It problem is known. Caused by Neovim core behavior.
Not related deoplete.nvim.

I and Shougo do not know solved way. Sorry.

@eduardoHoefel Please read :help popupmenu-keys. It is feature.

YouCompleteMe in neovim still supports selecting and inserting text using arrow keys alone. Is there any workaround to achieve this in deoplete ? Thanks

@emilsoman

Hm....
Why don't you create mappings like this?
It is not hard. So, I have answered to read :help popupmenu-keys.

inoremap <expr><Down>    pumvisible() ?   "\<C-n>"  : "\<Down>"
inoremap <expr><Up>    pumvisible() ?   "\<C-p>"  : "\<Up>"

@Shougo this works as expected. Thanks for the snippet!

Hello, I would like to be able to do the following,
inoremap <expr><Down> pumvisible() ? "\<C-j>" : "\<Down>"
inoremap <expr><Up> pumvisible() ? "\<C-k>" : "\<Up>"
but when I press <C-j> it just inserts whatever is highlighted and jumps to the next line.

I'd also like to be able to select an entry with <C-l> (that's an 'L'). Any way to do this? Thanks

@randre03 I don't understand.
What is the desired behavior? We have not ESP skills.

When the autocomplete options show up, I would like to use <C-j> to move down the list of options (as opposed to <C-n>). I would like to use <C-k> to move back up the list of options (as opposed to <C-p>) . To insert the selected option I would like to be able to use <C-l> (that is still an “L”).

Your lack of ESP is concerning . Perhaps you should consult a Health Care professional.

Perhaps you should consult a Health Care professional.

Hahaha, really?

When the autocomplete options show up, I would like to use <C-j> to move down the list of options (as opposed to <C-n>). I would like to use <C-k> to move back up the list of options (as opposed to <C-p>) . To insert the selected option I would like to be able to use <C-l> (that is still an “L”).

It is very clear answer. I understand.
I have known your configuration seems wrong.
But I cannot understand your desired behavior from your previous comment.
https://github.com/Shougo/deoplete.nvim/issues/246#issuecomment-343627162

The solution is here.

inoremap <expr><C-j> pumvisible() ? "\<C-n>" : "\<Down>"
inoremap <expr><C-k> pumvisible() ? "\<C-p>" : "\<Up>"
inoremap <expr><C-l> pumvisible() ? "\<C-y>" : "\<C-l>"

This is what I needed. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

callmekohei picture callmekohei  ·  5Comments

Zundrium picture Zundrium  ·  6Comments

tcstory picture tcstory  ·  5Comments

marcus picture marcus  ·  6Comments

westlywright picture westlywright  ·  6Comments