我正在寻找一种配置 (init.vim) 以在使用 deoplete 插件下拉菜单选择时扩展 Neosnippet。
到目前为止我所做的:
call plug#begin ('~/.local/share/nvim/plugged')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/neosnippet.vim' | Plug 'Shougo/neosnippet-snippets'
call plug#end ()
" Use deoplete.
let g:deoplete#enable_at_startup = 1
" Use smartcase.
let g:deoplete#enable_smart_case = 1
" Set minimum syntax keyword length.
let g:deoplete#sources#syntax#min_keyword_length = 2
这导致此屏幕:
现在我想扩展这个片段,当点击
<Enter>
时在选择。有没有人建议如何实现这一目标?感谢您的时间和最好的问候,
贝费多
最佳答案
Neosnippets 不会自动扩展。您需要配置键映射。该项目建议使用 Ctr+k 扩展它们:
" Plugin key-mappings.
" Note: It must be "imap" and "smap". It uses <Plug> mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
如果要在使用弹出菜单时扩展它们,请使用以下命令:
inoremap <silent><expr><CR> pumvisible() ? deoplete#mappings#close_popup()."\<Plug>(neosnippet_expand_or_jump)" : "\<CR>"
关于vim - 如何使用 deoplete 下拉菜单自动展开 Neosnippet?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42024254/