-
Notifications
You must be signed in to change notification settings - Fork 49
Support for deoplete plugins #50
Comments
It's easier to have full deoplete as one of the sources. But I don't want to maintain this feature. So Here's the code: " force init deoplete then hack deoplete's mapping
call deoplete#enable()
" register as ncm source
au User CmSetup call cm#register_source({'name' : 'deoplete',
\ 'priority': 7,
\ 'abbreviation': '',
\ })
" hack deoplete's mapping
inoremap <silent> <Plug>_ <C-r>=g:Deoplete_ncm()<CR>
func! g:Deoplete_ncm()
" forward to ncm
call cm#complete('deoplete', cm#context(), g:deoplete#_context.complete_position + 1, g:deoplete#_context.candidates)
return ''
endfunc
It is possible to support deoplete's python source. But that might take a lot of work. So I have no plan for this currently. |
@roxma so, by using this snippet, is not necessary to have installed deoplete too? I wanna start using this plugin as my only autocomplete manager, but |
@charliesbox The snippet needs deoplete. Looks like elm-vim has omni function. You could use simillar config as it is for css. Note that omni completion is running on the same thread as nvim's main thread, though. I'd rather create a plugin for ncm if I have the time. " css completion via `csscomplete#CompleteCSS`
" The `'cm_refresh_patterns'` is PCRE.
" Be careful with `'scoping': 1` here, not all sources, especially omnifunc,
" can handle this feature properly.
au User CmSetup call cm#register_source({'name' : 'cm-css',
\ 'priority': 9,
\ 'scoping': 1,
\ 'scopes': ['css','scss'],
\ 'abbreviation': 'css',
\ 'cm_refresh_patterns':[':\s+\w*$'],
\ 'cm_refresh': {'omnifunc': 'csscomplete#CompleteCSS'},
\ }) |
there's a PR to support deoplete :) ElmCast/elm-vim#120 That would be awesome! If I can help you to have it as fast as possible, let me know. I have never worked in a vim plugin, but I really need this autocomplete sources, and I know some others will too ! (At least, that's what I've been watching in others .vimrc files in github :) ) |
@charliesbox Please test this fork: https://github.com/roxma/elm-vim I think it's working for me, though, I'm not familiar with elm. I'll open a pr after you confirm it's working. |
@roxma is not working for me :( did you added an extra config along with the plugin? When I press, for example, |
Something to note when forwarding completions from deoplete as above, you should disable the following:
This is because NCM already implements those completions (at relatively the same speed too). |
There's a lot of deoplete plugins that exist. Would it be possible to add support for those in this library? Or maybe just to have full deoplete as one of the sources.
The text was updated successfully, but these errors were encountered: