diff options
Diffstat (limited to '.vim/after')
-rw-r--r-- | .vim/after/plugin/mucomplete.vim | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/.vim/after/plugin/mucomplete.vim b/.vim/after/plugin/mucomplete.vim index 98146aa..788ddf6 100644 --- a/.vim/after/plugin/mucomplete.vim +++ b/.vim/after/plugin/mucomplete.vim @@ -1,7 +1,7 @@ let g:mucomplete#enable_auto_at_startup = 1 let g:mucomplete#minimum_prefix_length = 1 let g:mucomplete#empty_text_auto = 1 - +let g:mucomplete#no_mappings = 1 let g:mucomplete#can_complete = {} let s:default_cond = { t -> t =~# '\%(\.\)$' } @@ -9,5 +9,29 @@ let g:mucomplete#can_complete.default = { 'omni': s:default_cond } let g:mucomplete#chains = {} let g:mucomplete#chains.default = [ 'ulti', 'user', 'omni', 'keyn', 'path' ] +imap <s-tab> <plug>(MUcompleteBwd) + +" Integrate with UltiSnips + +inoremap <silent> <expr> <plug>MyCR + \ mucomplete#ultisnips#expand_snippet("\<cr>") +imap <cr> <plug>MyCR + +let g:ulti_expand_or_jump_res = 0 + +fun! TryUltiSnips() + if !pumvisible() " With the pop-up menu open, let Tab move down + call UltiSnips#ExpandSnippetOrJump() + endif + return '' +endf + +fun! TryMUcomplete() + return g:ulti_expand_or_jump_res ? "" : "\<plug>(MUcompleteFwd)" +endf + +inoremap <plug>(TryUlti) <c-r>=TryUltiSnips()<cr> +imap <expr> <silent> <plug>(TryMU) TryMUcomplete() +imap <expr> <silent> <tab> "\<plug>(TryUlti)\<plug>(TryMU)" packadd vim-mucomplete |