Shougo / neocomplcache.vim

Ultimate auto-completion system for Vim.
http://www.vim.org/scripts/script.php?script_id=2620
1.72k stars 135 forks source link

Can't get neocomplcache to work. #481

Closed diokey closed 10 years ago

diokey commented 10 years ago

Hi,

I installed neocomplete with vundle but everytime i hit the enter key i get this error :

Error detected while processing function <SNR>7_my_cr_function: line    1:
E117: Unknown function: neocomplcache#smart_close_popup
Press ENTER or type command to continue
Error detected while processing function <SNR>7_my_cr_function:line    1:
E15: Invalid expression: neocomplcache#smart_close_popup() . "\<CR>"
Press ENTER or type command to continue

Here is the configuration i'm using. Can you help me fing anything wrong i'm doing?

let g:neocomplcache_enable_at_startup = 1
 " Use smartcase.
 let g:neocomplcache_enable_smart_case = 1
 " Set minimum syntax keyword length.
 let g:neocomplcache_min_syntax_length = 3
 let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'

 " Enable heavy features.
 " Use camel case completion.
 let g:neocomplcache_enable_camel_case_completion = 1
 " Use underbar completion.
 let g:neocomplcache_enable_underbar_completion = 1

 " Define dictionary.
 let g:neocomplcache_dictionary_filetype_lists = {
     \ 'default' : '',
     \ 'vimshell' : $HOME.'/.vimshell_hist',
     \ 'scheme' : $HOME.'/.gosh_completions'
        \ }

 " Define keyword.
 if !exists('g:neocomplcache_keyword_patterns')
    let g:neocomplcache_keyword_patterns = {}
 endif
 let g:neocomplcache_keyword_patterns['default'] = '\h\w*'

 " Plugin key-mappings.
 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 <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
 function! s:my_cr_function()
  return neocomplcache#smart_close_popup() . "\<CR>"
 "      For no inserting <CR> key.
 "     return pumvisible() ? neocomplcache#close_popup() : "\<CR>"
        endfunction
 " <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()

 " Enable omni completion.
 autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
 autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
 autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
 autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
 autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags

 " Enable heavy omni completion.
 if !exists('g:neocomplcache_omni_patterns')
  let g:neocomplcache_omni_patterns = {}
 endif
 let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
 let g:neocomplcache_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
 let g:neocomplcache_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'

I don't understand because i'm using a .vimrc file (https://github.com/diokey/myvimconfig/blob/master/.vimrc) that works perfectly on another machine. My vim version is 7.3.429 and it's running on Ubuntu 12.04

Thanks

Shougo commented 10 years ago

I think your errored machine is not installed neocomplcache. You should check it or reinstall it.