Skip to content
This repository has been archived by the owner on Jul 27, 2018. It is now read-only.

Show pop-up menu and trigger completion (Ultisnips + NCM) #164

Open
filipekiss opened this issue Nov 29, 2017 · 2 comments
Open

Show pop-up menu and trigger completion (Ultisnips + NCM) #164

filipekiss opened this issue Nov 29, 2017 · 2 comments

Comments

@filipekiss
Copy link
Contributor

So I've followed the instructions here to setup C-U to trigger the completion menu or expand the UltiSnips trigger.

Most of the time it works as expected, but there's something I don't know how to solve: pressing C-U to trigger the pop-up in the middle of the line yields no results, but if I do it at the beginning of the line it works perfectly.

Here's a demo of the problem:

2017-11-29 12 23 29

Here's my NCM/UltiSnips config:

let g:UltiSnipsExpandTrigger		= "<Plug>(ultisnips_expand)"
let g:UltiSnipsJumpForwardTrigger	= "<c-j>"
let g:UltiSnipsJumpBackwardTrigger	= "<c-k>"
let g:UltiSnipsRemoveSelectModeMappings = 0
inoremap <silent> <c-u> <c-r>=cm#sources#ultisnips#trigger_or_popup("\<Plug>(ultisnips_expand)")<cr>
inoremap <expr> <c-j> pumvisible() ? "\<C-n>" : "\<c-j>"
inoremap <expr> <c-k> pumvisible() ? "\<C-p>" : "\<c-k>"
xmap <c-u> <Plug>(ultisnips_expand)
smap <c-u> <Plug>(ultisnips_expand)

let g:cm_complete_delay = 0
let g:cm_sources_override = {
        \ 'cm-tags': {'enable':0}
        \ }

let g:UltiSnipsSnippetsDir='~/.dotfiles/config/vim/.vim/ultisnips'
let g:UltiSnipsSnippetDirectories=['ultisnips']
let g:UltiSnipsEditSplit='context'

What am I doing wrong?

Thanks!

@seb-mueller
Copy link

Just as a hunch, it might have to do with the snippet option itself (see here or :h UltiSnips-snippet-options).
Am Ultisnip snippet can be configured to only expand at the beginning of a line, maybe you have the b option set?

@filipekiss
Copy link
Contributor Author

@seb-mueller Not really. My :aut snippet, for example, can be expanded anywhere on the line and doesn't show up if there's a space and I invoke C-u. After I type a few letters the completion menu will pop-up, no problem, but if I trigger it manually it only works at the beginning of the line.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants