-- Copilot must be enabled in comnfig/options.lua or config/local.lua if vim.g.codeium ~= true then return {} end return { -- codeium -- Don't import the extras, because it loads on everything, and we only want it on certain filetypes --{ -- import = "lazyvim.plugins.extras.ai.codeium", --}, { -- https://github.com/Exafunction/codeium.nvim "Exafunction/codeium.nvim", -- clear default event event = function() return {} end, dependencies = { { "hrsh7th/nvim-cmp", optional = true, opts = function(_, opts) table.insert(opts.sources, 1, { name = "codeium", group_index = 1, priority = 100, }) end, }, { "nvim-lualine/lualine.nvim", optional = true, event = "VeryLazy", opts = function(_, opts) table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("codeium")) end, }, }, opts = { enable_cmp_source = vim.g.ai_cmp, virtual_text = { enabled = not vim.g.ai_cmp, key_bindings = { accept = false, -- handled by nvim-cmp / blink.cmp next = "", prev = "", }, }, }, init = function() require("lazyAnd").FileType_InsertEnter(vim.g.codeium_ft, "codeium.nvim") end }, -- add ai_accept action { "Exafunction/codeium.nvim", opts = function() LazyVim.cmp.actions.ai_accept = function() if require("codeium.virtual_text").get_current_completion_item() then LazyVim.create_undo() vim.api.nvim_input(require("codeium.virtual_text").accept()) return true end end end, }, }