Shougo / deoplete.nvim

:stars: Dark powered asynchronous completion framework for neovim/Vim8
Other
5.94k stars 295 forks source link

How can I get snippets support in completion sources? #1103

Closed krisfans closed 4 years ago

krisfans commented 4 years ago

Problems summary

When I edit a python file ,I just want to deoplete-jedi and neosnippet this two completion sources without others, what should I do?

Expected

open a python file ,there is no neosnippet's code snippets Snipaste_2020-06-10_23-28-19

Environment Information

Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

" Your minimal init.vim/vimrc
call plug#begin('$HOME/.vim/plugged') 
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'kristijanhusak/defx-icons'
Plug 'Shougo/neoinclude.vim'
Plug 'Shougo/neosnippet.vim'
Plug 'Shougo/neosnippet-snippets'
Plug 'zchee/deoplete-jedi', { 'for':'python' }
call plug#end()
let g:plugged#enable_at_startup = 1 
"---------------deoplete-------------"
if has('nvim')
    let g:python3_host_prog = "D:/Software/Python/Python38-32/python.exe"
endif
let g:deoplete#enable_at_startup = 1
call deoplete#custom#option({
            \ 'auto_complete_delay': 200,
            \ 'smart_case': v:true,
            \ })
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif

call deoplete#custom#option('sources', {
            \ 'python':['jedi','snippet'],
            \})

imap <C-k>     <Plug>(neosnippet_expand_or_jump)
smap <C-k>     <Plug>(neosnippet_expand_or_jump)
xmap <C-k>     <Plug>(neosnippet_expand_target)

How to reproduce the problem from neovim/Vim startup (Required!)

1.open a empty python 2.type im(import)

Shougo commented 4 years ago

neosnippet-snippets does not have import snippet. So this is feature.

If you input if, you can get ifmain snippet.

Shougo commented 4 years ago

And your configuration is wrong.

It must be:

call deoplete#custom#option('sources', {
            \ 'python':['jedi','neosnippet'],
            \})