Closed roxma closed 7 years ago
Ultisnips is kind of heavy and complicated for me.
So I started looking into neosnippet by @Shougo. It's more lightweight and easier to integrate, since it has been integrated in neocomplete already. Although I don't enjoy the display of '<2:foo:
>' placeholder. It's simple, and it works well.
Requirement: installation of neosnippet and let g:neosnippet#enable_completed_snippet=1
Here's a screencast for python completion and expansion:
A +
sign means the completion item is expandable.
This feature is still experimental.
Besides, the syntax of neosnippet by @Shougo and snipmate maintained by @garbas seems to be compatible at some level.
I'll look into snipmate as another alternative when I have some free time available.
Just take a deeper look into ultisnips, now it works with ultisnips, :smile:
Closing this, snipmate support may be implemented in the future. But this is not high priority.
snipmate is supported now
config:
let g:snips_no_mappings = 1
" imap <expr> <c-u> pumvisible() ? "\<c-y>\<Plug>snipMateTrigger" : "\<Plug>snipMateTrigger"
" wrap the mapping
imap <expr> <Plug>(snipmate_force_trigger) pumvisible() ? "\<c-y>\<Plug>snipMateTrigger" : "\<Plug>snipMateTrigger"
" show a list of snippets when no the user has typed nothing
inoremap <silent> <c-u> <c-r>=cm#sources#snipmate#trigger_or_popup("\<Plug>(snipmate_force_trigger)")<cr>
vmap <c-u> <Plug>snipMateTrigger
imap <expr> <c-j> pumvisible() ? "\<c-y>\<Plug>snipMateNextOrTrigger" : "\<Plug>snipMateNextOrTrigger"
vmap <c-j> <Plug>snipMateNextOrTrigger
imap <expr> <c-k> pumvisible() ? "\<c-y>\<Plug>snipMateBack" : "\<Plug>snipMateBack"
vmap <c-k> <Plug>snipMateBack
// cc @ajzafar @garbas
Does anything special need to be done in order to get snippets provided by Ultisnips to expand?
@Battleroid
No. This issue is about parameter expansion.
@battleroid I’m not sure what you need. But this might be useful. https://github.com/roxma/nvim-completion-manager/issues/89
Thank you, I'll poke at it.
For example:
|
is the cursor position afterfoobar
is completed by NCM, then press ultisnips expand trigger should expand the completion intoI'm not sure whether this is possible but it's worth a try