quangnguyen30192/cmp-nvim-ultisnips

Add support for VISUAL

anstadnik opened this issue · 1 comments

Ultisnips has a possibility to visually select some words, and then expand the snippet. The selected lines automatically appear in the ${VISUAL} placeholder.
Documentation for this
Is it possible to implement that in this plugin?

Since hrsh7th/nvim-cmp#438 this is possible:

vim.g.UltiSnipsExpandTrigger = '<Plug>(ultisnips_expand)'
...
cmp.setup {
    snippet = {expand = function(args) vim.fn["UltiSnips#Anon"](args.body) end},
    mapping = {
        ["<C-l>"] = cmp.mapping({
...
            x = function()
                vim.api.nvim_feedkeys(t("<Plug>(ultisnips_expand)"),
                                      'm', true)
            end
        }),
...