codeium.vim icon indicating copy to clipboard operation
codeium.vim copied to clipboard

nvim-cmp and <tab> conflict

Open silentjay opened this issue 2 years ago • 1 comments

Is there a way to get codeium to override the nvim-cmp when using <tab> to accept codeium suggestions in insert mode? Currently if there are nvim-cmp suggestions then <tab> cycles through these instead. Is there a way of having codeium take priority as the nvim copilot plugin does out the box? I don't want to remap accept to <C-g> nor do I want to integrate codeium into nvim-cmp.

silentjay avatar Dec 04 '23 19:12 silentjay

i use tab for snippet jumps and codeium completion accept (i trigger it manualy when needed) so my mapping in lazy plugin manager looks like this

keys = {
	{
	    "<tab>",
	    function()
                return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or vim.fn["codeium#Accept"]()
	    end,
	expr = true,
	silent = true,
	mode = "i",
}

u can try similar thing (i dont know how consistent it will be on auto suggestions because of response delay) maybe need a bit complicated if/else with cmp.visable and vim.b._codeium_completion ~=nil if u map it inside cmp.mappings table

hornyjailfish avatar Feb 20 '24 12:02 hornyjailfish