Hi @Shougo
How can I add my neosnippet snippets as a source to the sources dictionary so I can also complete and expand together with my other sources (such as from deoplete-go or buffer).
I couldn't find it inside the doc, nor could I see it in the closed issues.
Thanks
Seem's like it's already included but doesn't expand when I hit enter (<CR>) even though I have this:
inoremap <silent><expr><CR> pumvisible() ? "\<C-y>" : "\<CR>"
(edit: Changed the title to make it more clear)
Ok I've fixed and customized it according to my own needs. If anyone is curious below is the implementation I use tab for expanding both a snippet and also use it to jump to the next item inside a completion menu.
But note that I have disabled neosnippet as a source as I don't want to have any kind of completion for it:
let g:deoplete#ignore_sources = {}
let g:deoplete#ignore_sources._ = ["neosnippet"]
If you want to have snippets in your completion menu you have to change the logic. But it's fairly easy, just change the function below. Here is the function which implements a custom tab mapping for the insert mode:
" I want to use my tab more smarter. If we are inside a completion menu jump
" to the next item. Otherwise check if there is any snippet to expand, if yes
" expand it. Also if inside a snippet and we need to jump tab jumps. If none
" of the above matches we just call our usual 'tab'.
function! s:neosnippet_complete()
if pumvisible()
return "\<c-n>"
else
if neosnippet#expandable_or_jumpable()
return "\<Plug>(neosnippet_expand_or_jump)"
endif
return "\<tab>"
endif
endfunction
imap <expr><TAB> <SID>neosnippet_complete()
Most helpful comment
Ok I've fixed and customized it according to my own needs. If anyone is curious below is the implementation I use
tabfor expanding both a snippet and also use it to jump to the next item inside a completion menu.But note that I have disabled
neosnippetas a source as I don't want to have any kind of completion for it:If you want to have snippets in your completion menu you have to change the logic. But it's fairly easy, just change the function below. Here is the function which implements a custom
tabmapping for the insert mode: