Closed aymericbeaumet closed 11 years ago
Please read documentation.
inoremap <expr><C-y> neocomplcache#close_popup()
inoremap <expr><C-e> neocomplcache#cancel_popup()
I read the documentation and I tried what you mentionned, but it totally disable <C-y>
and <C-e>
behavior in insert mode.
It totally disable
and behavior in insert mode.
You can custom these mappings.
I understand that I have to rebind these keys, but I can't find how to restore the default vim behavior,
I have the same problem here. It turns out that closing an open popup actually is the default behavior for those keys. See help tags complete_CTRL-E and complete_CTRL-Y.
Thanks for you answer @Ferreus9001.
In insert mode, I expect this behaviour:
<C-y>
copy the character from the above line<C-y>
again will close the completion popup and copy the character from the above lineThe below code closes the completion popup:
inoremap <expr><C-y> neocomplcache#close_popup()
inoremap <expr><C-e> neocomplcache#cancel_popup()
How to do the other actions?
I think i found a solution:
inoremap <expr> <C-y> pumvisible() ? "\<C-y>\<C-y>" : "\<C-y>"
inoremap <expr> <C-e> pumvisible() ? "\<C-y>\<C-e>" : "\<C-e>"
Note that the popup is always closed with <C-y>
or it won't work.
Unfortunately it doesn't work for me... When I use your binds and type <C-y>
in insert mode, I really write <C-y>
in the editor. Does this solution work for you?
Hum it works, I found the problem. In my vim version (7.3) the cpoptions
option causes a problem. When I removed it, everything worked fine!
I encounter a problem while typing
<C-e>
or<C-y>
in insert mode.When I activate neocomplcache, I have to type
<C-e>
or<C-y>
two times to do the expected behavior.How can I fix this?