roxma / nvim-completion-manager

:warning: PLEASE USE https://github.com/ncm2/ncm2 INSTEAD
MIT License
916 stars 49 forks source link

UltiSnips in VISUAL #206

Open luzik opened 6 years ago

luzik commented 6 years ago

With let g:UltiSnipsExpandTrigger = "<tab>" I can Shift+v, select lines, press TAB writetryTAB and I got python try except snip working with selected lines inside.

After using NCM documented:

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>
imap <expr> <CR>  (pumvisible() ?  "\<c-y>\<Plug>(expand_or_nl)" : "\<CR>")
imap <expr> <Plug>(expand_or_nl) (cm#completed_is_snippet() ? "\<C-U>":"\<CR>")

I am unable to do same thing with Ctrl-u. Am I missing something ?