diff --git a/lua/astrocommunity/completion/codeium-vim/init.lua b/lua/astrocommunity/completion/codeium-vim/init.lua index 890297df7..68070618f 100644 --- a/lua/astrocommunity/completion/codeium-vim/init.lua +++ b/lua/astrocommunity/completion/codeium-vim/init.lua @@ -1,17 +1,45 @@ return { "Exafunction/codeium.vim", - event = "User AstroFile", - config = function() - vim.keymap.set("i", "", function() return vim.fn["codeium#Accept"]() end, { expr = true }) - vim.keymap.set("i", "", function() return vim.fn["codeium#CycleCompletions"](1) end, { expr = true }) - vim.keymap.set("i", "", function() return vim.fn["codeium#CycleCompletions"](-1) end, { expr = true }) - vim.keymap.set("i", "", function() return vim.fn["codeium#Clear"]() end, { expr = true }) - vim.keymap.set("n", ";", function() - if vim.g.codeium_enabled == true then - vim.cmd "CodeiumDisable" - else - vim.cmd "CodeiumEnable" - end - end, { noremap = true, desc = "Toggle Codeium active" }) - end, + cmd = { + "Codeium", + "CodeiumEnable", + "CodeiumDisable", + "CodeiumToggle", + "CodeiumAuto", + "CodeiumManual", + }, + event = "BufEnter", + dependencies = { + "AstroNvim/astrocore", + ---@type AstroCoreOpts + opts = { + mappings = { + n = { + [";"] = { + "CodeiumToggle", + noremap = true, + desc = "Toggle Codeium active", + }, + }, + i = { + [""] = { + function() return vim.fn["codeium#Accept"]() end, + expr = true, + }, + [""] = { + function() return vim.fn["codeium#CycleCompletions"](1) end, + expr = true, + }, + [""] = { + function() return vim.fn["codeium#CycleCompletions"](-1) end, + expr = true, + }, + [""] = { + function() return vim.fn["codeium#Clear"]() end, + expr = true, + }, + }, + }, + }, + }, }