I just started using vim and saw a cool plugin: neocomplcache.

My problem is that I can't get it to work properly. After installing, I took the example config from the help files of neocomplcache and added the lines to my .vimrc

At first I wanted to create a simple LaTeX file (there are snippets for TeX). After typing "begi" there appears a menu, I can choose between the snippets with Tab or Ctrl-N. But how do I get them to expand? Ctrl-K does not work, but I don't understand why.



" Plugin key-mappings.

imap <C-k>     <Plug>(neocomplcache_snippets_expand)

smap <C-k>     <Plug>(neocomplcache_snippets_expand)

inoremap <expr><C-g>     neocomplcache#undo_completion()

inoremap <expr><C-l>     neocomplcache#complete_common_string()

" Recommended key-mappings.

" <CR>: close popup and save indent.

inoremap <expr><CR>  neocomplcache#smart_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()

  • I have <C-k> just works now with Neocomplcache version 6.0. is there any key-mapping conflict? what does :verbose map <c-k> shows? – number5 Mar 2 '11 at 0:09

Typing <C-y> will insert the selected keyword and close the popup.
Typing <C-l> will insert the common substring between the matches in the popup.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.