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

neocomplcache ver.8 milestone #373

Closed Shougo closed 11 years ago

Shougo commented 11 years ago

I have developped neocomplcache ver.8.

ver.8 aims are:

  1. refactorred internal interface
  2. improved neocomplcache source interface(improve compatibility of unite.vim source) and source documentation
  3. implement filters(matchers, sorters, converters like unite.vim)
  4. support if_lua interface
  5. optimize memory and speed
  6. real fuzzy matching(if_lua required)
ujihisa commented 11 years ago

+1

lookforit commented 11 years ago

It's exciting !

zhaocai commented 11 years ago

looks promising!

Shougo commented 11 years ago

Refactorred neocomplcache is in ver.8 branch. But it is very unstable.

support if_lua interface

This feature is friezed until fixing if_lua problem.

Shougo commented 11 years ago

Current ver.8.0 progress:

  1. refactorred internal interface -> 80% OK
  2. improved neocomplcache source interface(improve compatibility of unite.vim source) and source documentation -> 20% writing now
  3. implement filters(matchers, sorters, converters like unite.vim) -> later(after improved source interface)
  4. support if_lua interface -> experimental support
  5. optimize memory and speed -> 90% OK
  6. real fuzzy matching(if_lua required) -> later(after implemented filters)

I think neocomplcache ver.8 has killer features(like YouCompleteMe).

UncleBill commented 11 years ago

Neo: Trinity,you complete me.LOL

zhaocai commented 11 years ago

have not tried YouCompleteMe. It looks nice based on the stars and readme. Is there anyway to integrate neocomplcache with YouCompleteMe at this time? How do you think of the differences? Thanks.

zhaocai commented 11 years ago

Tried YouCompleteMe. There are a few things I like:

But compared with neocomplcache, I consider it as "incomplete" - lack of many features like snippets_complete, tags_complete, etc.

I just recompiled MacVim with if-lua support, will this help the speed of neocomplcache ver8? Thanks.

lookforit commented 11 years ago

I don’t think YCM can replace neo.

Neo is more powerful and much easier to use.

If neo can make jedi and pydict integrated , it will be perfect for pythoner!

Shougo commented 11 years ago

have not tried YouCompleteMe. It looks nice based on the stars and readme. Is there anyway to integrate neocomplcache with YouCompleteMe at this time? How do you think of the differences? Thanks.

No. I cannot integrate with YouCompleteMe.

the speed of completion real fuzzy match

I will implement it in ver.8.

integration with syntastic

I have not the plan to implement this feature.

good support for c-family completion

You can use it with neocomplcache and clang_complete.

But compared with neocomplcache, I consider it as "incomplete" - lack of many features like snippets_complete, tags_complete, etc.

Yes.

I just recompiled MacVim with if-lua support, will this help the speed of neocomplcache ver8? Thanks.

Yes. But this feature is incomplete. I will improve it later. I recommend you to enable if_lua in Vim.

Shougo commented 11 years ago

I don’t think YCM can replace neo. Neo is more powerful and much easier to use. If neo can make jedi and pydict integrated , it will be perfect for pythoner!

Yes. To enable YouCompleteMe is too hard(and it has a lot of crash problem). You can use jedi with neocomplcache(Please read FAQ). What is pydict? I don't know it...

lookforit commented 11 years ago

Thanks for your attention and be sorry to omit the jedi –integrated feature .

I tried this feature as the FAQ instructs ,and I’d like to say something about what I expect for this feature :

when I typed a object and dot ,all the pre –defined methods are listed automatically. after I selecting a item ,also the

MRU will take effect for this object ‘s next time ”dot ” popup.

Is there any way to make neo behave like this ?

Here is the pydict detail : https://github.com/vim-scripts/Pydiction

Shougo commented 11 years ago

Can you upload screenshot? I want to know more detail.

Here is the pydict detail : https://github.com/vim-scripts/Pydiction

OK. I will check later. I think you can use neocomplcache with pydiction. But it may be slow(because pydiction dictionary is too large).

zhaocai commented 11 years ago

Thanks for the update. I have not check the FAQ for a while. Now I got jedi.vim and clang_complete working. great

lookforit commented 11 years ago

you see, the menu poped up automatically by jedi.vim when press dot, listing all the methods the object can call. but this menu is lack of MRU and fuuzy match features ,which can be provided by neo . jedi_neo

lookforit commented 11 years ago

for pydiction case ,i think i can put up with the long time to load items ,as long as it is supported by neo .

Shougo commented 11 years ago

you see, the menu poped up automatically by jedi.vim when press dot, listing all the methods the object can call. but this menu is lack of MRU and fuuzy match features ,which can be provided by neo .

What's your configuration of neocomplcache? I think it is not used neocomplcache.

lookforit commented 11 years ago

hi ,here is the corresponding setting :

" 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 <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()

"Enter select items:
inoremap <expr><space>  pumvisible() ? neocomplcache#close_popup()  : "\<SPACE>"
"Caching everywhere:
noremap <Leader>neo :NeoComplCacheCachingBuffer<CR>:NeoComplCacheCachingTags<CR>

" 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.ruby = '[^. *\t]\.\h\w*\|\h\w*::'
"autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
let g:neocomplcache_omni_patterns.c = '\%(\.\|->\)\h\w*'
let g:neocomplcache_omni_patterns.cpp = '\h\w*\%(\.\|->\)\h\w*\|\h\w*::'

" For perlomni.vim setting.
" https://github.com/c9s/perlomni.vim
let g:neocomplcache_omni_patterns.perl = '\h\w*->\h\w*\|\h\w*::'

" For rank priority setting in the popup list
let g:neocomplcache_source_rank = {
            \'snippets_complete' : 4,
            \ 'buffer_complete' : 8
            \ }

" For jedi-Vim
let g:jedi#auto_vim_configuration = 0
let g:jedi#show_function_definition = "0"
let g:jedi#popup_select_first = 0

" For jedi-Neo integrated : 
if !exists('g:neocomplcache_omni_functions')
    let g:neocomplcache_omni_functions = {}
endif
let g:neocomplcache_omni_functions.python = 'jedi#complete'
let g:jedi#popup_on_dot = 1
Shougo commented 11 years ago

but this menu is lack of MRU and fuuzy match features ,which can be provided by neo .

Oh, it is feature. Because, current fuzzy match is not supported omnifunc. This feature may be changed in neocomplcache ver.8. And currently disabled sorting in omnifunc. Because there was the demand.

Shougo commented 11 years ago

for pydiction case ,i think i can put up with the long time to load items ,as long as it is supported by neo .

You should install vimproc to save startup time. I tested pydiction as neocomplcache dictionary, but it is not slow.

lookforit commented 11 years ago

Thanks for your updating to pydiction.I will try it at once!

lookforit commented 11 years ago

Oh, it is feature. Because, current fuzzy match is not supported omnifunc. This feature may be changed in neocomplcache ver.8. And currently disabled sorting in omnifunc. Because there was the demand

that's to say ,neither of these two features can apply to jedi in the current neo ?

Shougo commented 11 years ago

Yes.

lookforit commented 11 years ago

hi . to use pydtiction , my neo configuration is this :

_let g:neocomplcache_dictionary_filetypelists = { \ 'default' : '', _\ 'python' : 'D:\Programe files\Vim\vimfiles\bundle\pydiction-1.2.1\complete-dict', \ 'vimshell' : $HOME.'/.vimshellhist', _\ 'scheme' : $HOME.'/.goshcompletions' \ }

but none of item can be listed automatically ,is there anything wrong with the configuration ? ps: neo is upgraded to latest version of master .

Shougo commented 11 years ago

You can check the dictionary path by:

:echo filereadable(neocomplcache#util#substitute_path_separator(fnamemodify(g:neocomplcache_dictionary_filetype_lists['python'], ':p')))

but none of item can be listed automatically ,is there anything wrong with the configuration ?

You have to wait until vimproc finishes making cache.

lookforit commented 11 years ago

You can check the dictionary path by:

:echo filereadable(neocomplcache#util#substitute_path_separator(fnamemodify(g:neocomplcache_dictionar

this returns 1

You have to wait until vimproc finishes making cache.

very long time i waited. when i typed 3rd(neocomplcache_min_syntax_length = 3) character , the status line says : "user defined completion (^U^N^P) can't find pattern "

Shougo commented 11 years ago

You can make cache manually by :NeoComplCacheCachingDictionary. And check to the g:neocomplcache_data_directory/dictionary_cache directory. If you set g:neocomplcache_enable_debug to 1, you can check making cache timing.

lookforit commented 11 years ago

You can make cache manually by :NeoComplCacheCachingDictionary

the problem is not only dictionary items can't poped up ,but also other types of completion disappeared ,such as buffer ,syntax ,and tags etc .

Shougo commented 11 years ago

In my environment, neocomplcache works. Hmmmm... Please update neocomplcache. I updated it.

lookforit commented 11 years ago

In my environment, neocomplcache works. Hmmmm..

can you show your neo configuration ? i want to check it with my _vimrc.

Shougo commented 11 years ago

No. My configuration is too long. Please show me your minimal neocomplcache settings. I will check it.

lookforit commented 11 years ago

No. My configuration is too long. Please show me your minimal neocomplcache settings. I will check it.

with pleasure .

Shougo commented 11 years ago

I think you should test minimal .vimrc and with only neocomplcache. I tested below settings but it works.

zhaocai commented 11 years ago

checked neocomplcache#util#has_lua()

1

but s:lua_filter is never called.

is it disabled or do i need to set some option to make it work?

Shougo commented 11 years ago

If you enabled heavy comletion(fuzzy completion or underbar completion or camel case completion), lua filter is not called. So I said "it is experimental".

zhaocai commented 11 years ago

thanks.

Shougo commented 11 years ago

the problem is not only dictionary items can't poped up ,but also other types of completion disappeared ,such as buffer ,syntax ,and tags etc .

I think I fixed the problem. Please update neocomplcache.

lookforit commented 11 years ago

I think I fixed the problem. Please update neocomplcache.

Thanks for that! I tried the latest push of master ,but the problem still exist...

Shougo commented 11 years ago

Thanks for that! I tried the latest push of master ,but the problem still exist...

Hummm. I fixed other same behavior by last commit. I think you should make minimal .vimrc and upload it. (Before configuration is too long and I'm not reappeared using it.) I will check.

Shougo commented 11 years ago

I updated ver.8 branch.

  1. refactorred internal interface -> 90% OK
  2. improved neocomplcache source interface(improve compatibility of unite.vim source) and source documentation -> 80% writing now
  3. implement filters(matchers, sorters, converters like unite.vim) -> later(after improved source interface)
  4. support if_lua interface -> experimental support
  5. optimize memory and speed -> 90% OK
  6. real fuzzy matching(if_lua required) -> later(after implemented filters)
zhaocai commented 11 years ago

about the choice of if_lua

It seems that if_lua is not widely compiled to vim. Based on neocomplcache#util#has_lua(), it looks like it also requires very new vim built.

so my question is, why if_lua? Many people may not be able to use it because they do not have the root privilege to recompile vim.

ujihisa commented 11 years ago

I guess you focused on a vim on remote shared server that people don't always have privilege to install vim for everyone on the server, but in that case I don't think people even try to use neocomplcache on the server since completion popup is really slow over ssh.

if_lua on neocomplcache makes sense for me, as long as it doesn't crash ;)

Shougo commented 11 years ago

if_lua on neocomplcache makes sense for me, as long as it doesn't crash ;)

Yes.

so my question is, why if_lua? Many people may not be able to use it because they do not have the root privilege to recompile vim.

OK. I answer the question.

  1. Pyhon interface is not used in every Vim environment. For example, Android, iOS, non configured Vim,...
  2. Incompatibility with Python2 and Python3. I must rewrite for it.
  3. Loading Python interface is slow(10~20ms). But loading Lua interface is too fast(270ns).
  4. Python2 and Python3 is not loaded at same time in Unix environment.
  5. Python is too big.
  6. Python interface is slow than Lua interface.
  7. Lua interface is stable(no crashed in latest Vim).
  8. Using C module(like vimproc, YouCompleteMe) is hard to compile in Windows environment.
  9. Using both Python and C like YouCompleteMe is too unstable. Your Vim may be crash or happen a mysterious error.
zhaocai commented 11 years ago

thanks for the update! By the way, does the current s:lua_filter function have any fuzziness?

Shougo commented 11 years ago

By the way, does the current s:lua_filter function have any fuzziness?

Yes. I will fix it later version in filters for neocomplcache.

Shougo commented 11 years ago

Updated status

  1. refactorred internal interface -> almost 100% OK(except new features)
  2. improved neocomplcache source interface(improve compatibility of unite.vim source) and source documentation -> 90% writing now
  3. implement filters(matchers, sorters, converters like unite.vim) -> 50%(except matcher)
  4. support if_lua interface -> experimental support
  5. optimize memory and speed -> 90% OK
  6. real fuzzy matching(if_lua required) -> later(after implemented matchers)

Unfortunately, if I enable neocomplcache ver.8 with matcher, wildcard and camel case completion feature and underbar completion features are disabled. And if your Vim is not enabled if_lua or too old, neocomplcache completion speed will slow(than before version). So, I will release neocomplcache ver.8(or ver.8-pre) before implementing matcher.

I highly recommend for you to use if_lua enabled Vim.

zhaocai commented 11 years ago

what is the progress now?

Shougo commented 11 years ago
  1. refactorred internal interface -> almost 100% OK(except user customization)
  2. improved neocomplcache source interface(improve compatibility of unite.vim source) and source documentation -> 90% OK(except user customization)
  3. implement filters(matchers, sorters, converters like unite.vim) -> 100% but matcher is ver.8.1
  4. support if_lua interface -> experimental: full support is ver.8.1
  5. optimize memory and speed -> 90% OK(rest is ver.8.1)
  6. real fuzzy matching(if_lua required) -> full support is ver.8.1

I think ver.8 branch will be merged completely to master in this week. After released ver.8.0, I will develop neocomplcache ver.8.1(contains new featured matchers). neocomplcache ver.8.1 has full features but it breaks backward compatibility(for example underbar completion, camel case completion)...

zhaocai commented 11 years ago

so fuzzy match will replace underbar completion, camel case completion, etc... I use these features a lot. But if fuzzy match is done right. It should be better.

Shougo commented 11 years ago

Yes. But to use fuzzy match, you must enable if_lua feature in Vim. In not if_lua featured Vim, underbar completion, wild card, fuzzy completion features are disabled and too slow. So this feature will be in ver.8.1.

In ver.8.1, neocomplcache detect not enabled if_lua environment and may warn.