Saturday, November 26, 2011

Re: NeoComplCache plugin set map to select from popup

HI, I'm the author of neocomplcache.

> I set NeoComplCache in my vimrc like this.
> All of those are from help file of NeoComplCache.
> I want to map <C-n>,<C-p> or <C-j>,<C-k> to select complete item from popup.
> Does anybody knows how to set this ?
> By the way, if you have good hints on my NeoComplCache setting. plese tell me.
> I will apperciate it.
> ( I know this setting is long, you can jump to map setting directly. )
...
>
>
>        " Plugin key-mappings.
>        " <CR>: close popup and save indent.
>        inoremap <expr><CR>  neocomplcache#close_popup() . "\<CR>"
>        " <TAB>: completion.
>        inoremap <expr><TAB>  pumvisible() ? "\<C-n>" : "\<TAB>"
>        " <C-h>, <BS>: close popup and delete backword char.
>        inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>"
>        inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
>        inoremap <expr><C-y>  neocomplcache#close_popup()
>        inoremap <expr><C-e>  neocomplcache#cancel_popup()
>        inoremap <expr><C-g>  neocomplcache#undo_completion()
>        " FIXME use <C-n>, <C-p> or <C-j>, <C-k> to select from popup.
>

What's your problem?
<C-n> and <C-p> are default mappings to select from popup.
<C-j> and <C-k> are not but you can mapping easily.

inoremap <expr><C-j> "\<C-n>" : "\<C-j>"
inoremap <expr><C-k> "\<C-p>" : "\<C-k>"

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment