Closed soyuka closed 7 years ago
Try this:
let g:mucomplete#user_mappings = { 'snip' : "\<plug>snipMateShow" }
let g:mucomplete#chains = { 'default': ['snip', 'keyn'] } " For instance
I think you also need:
let g:snipMate['no_match_completion_feedkeys_chars'] = ''
Adding this may also be convenient:
imap <expr> <c-j> (pumvisible()?"\<c-y>":"")."\<plug>snipMateNextOrTrigger"
(assuming that the SnipMate's trigger of your choice is <c-j>
), because it allows you to expand a snippet without first closing the pop-up menu.
Nice one, thanks
Just to make sure I understand everything
This adds snippets to the menu:
let g:mucomplete#user_mappings = { 'snip' : "\<plug>snipMateShow" }
let g:mucomplete#chains = { 'default': ['snip', 'keyn'] } " For instance
And
imap <expr> <c-j> (pumvisible()?"\<c-y>":"")."\<plug>snipMateNextOrTrigger"
Does expand the snippet with <c-j>
. Is there a way to make the tab
key to trigger the snippet?
Is there a way to make the tab key to trigger the snippet?
Sure:
imap <expr> <tab> (pumvisible()?"\<c-y>":"")."\<plug>snipMateNextOrTrigger"
Note that µcomplete maps <tab>
by default, so you should either disable µcomplete's mappings:
let g:mucomplete_no_mappings =1
or map the completion trigger (which by default is <tab>
) to something else, e.g.,
imap <c-j> <plug>(MUcompleteFwd)
See also :h mucomplete-mappings
.
let g:mucomplete_no_mappings =1
Sorry, that should be
let g:mucomplete#no_mappings = 1
Okay thanks I think I've enough elements to make it work!
For bug reports only, please provide the following details:
:help mucomplete-troubleshooting
.echo g:mucomplete#chains
:{'default': ['file', 'omni', 'keyn', 'dict']}
setl completeopt
:completeopt=menu,preview,menu,menuone,noinsert
.vimrc
, if any: let g:mucomplete#enable_auto_at_startup = 1First of all, thanks for trying to make vim completion simple and great again.
I want to avoid all those plugins that are not made with
vimL
, just because they're often a pain to install on a new computer. This is why I prefered SnipMate over UltiSnips (python). The thing is, I can't trigger the snippets, and though you may have a solution.I don't use any snipmate configuration, I just have the following (using
Vundle
):Should I do something in particular do add the snipmate support? Thanks!