cmp-cmdline icon indicating copy to clipboard operation
cmp-cmdline copied to clipboard

does not complete vim.ui.input

Open rebelot opened this issue 4 years ago • 4 comments

vim.ui.input accepts a completion option, however cmp-cmdline will not complete candidates, but wildmenu will. I presume same problem with vim.ui.select

es:

:lua vim.ui.input({prompt = "complete me: ", completion = 'dir'}, function(input) print(input) end)

rebelot avatar Nov 18 '21 15:11 rebelot

Yes. because the nvim-cmp's cmdline completion focueses to the : and / mode only at the moment.

hrsh7th avatar Feb 13 '22 12:02 hrsh7th

Hi @hrsh7th! How can I make the regular Tab (wildmode) completion work in vim.ui.input while still using nvim cmp cmdline? If I have the following config:

cmp.setup.cmdline(':', {
    mapping = cmp.mapping.preset.cmdline({
        -- Select candidate but don't execute with enter (do that with C-y)
        ['<CR>'] = {
            c = cmp.mapping.confirm({
                select = true,
            }),
        },
    }),
    sources = cmp.config.sources({
        { name = 'cmdline' },
    }, {
        { name = 'path' },
    }),
})

And try @rebelot snippet above then there is neither cmp nor regular Tab completion available. Any pointers are appreciated.

petobens avatar Jul 31 '22 16:07 petobens

you can do the following:

cmp.setup.cmdline("@", {
    sources = cmp.config.sources({
	    { name = "path" },
	    { name = "cmdline" },           
    }),
})

:h getcmdtype(), look at @

dsych avatar Nov 02 '22 03:11 dsych

Awesome. Thanks @dsych

petobens avatar Nov 03 '22 01:11 petobens