local prefix = "A" ---@type LazySpec return { { "olimorris/codecompanion.nvim", dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", { "AstroNvim/astrocore", ---@param opts AstroCoreOpts opts = function(_, opts) if not opts.mappings then opts.mappings = {} end opts.mappings.n[prefix] = { desc = require("astroui").get_icon("CodeCompanion", 1, true) .. "CodeCompanion" } opts.mappings.v[prefix] = { desc = require("astroui").get_icon("CodeCompanion", 1, true) .. "CodeCompanion" } opts.mappings.n[prefix .. "c"] = { "CodeCompanionChat Toggle", desc = "Toggle chat" } opts.mappings.v[prefix .. "c"] = { "CodeCompanionChat Toggle", desc = "Toggle chat" } opts.mappings.n[prefix .. "p"] = { "CodeCompanionActions", desc = "Open action palette" } opts.mappings.v[prefix .. "p"] = { "CodeCompanionActions", desc = "Open action palette" } opts.mappings.n[prefix .. "q"] = { "CodeCompanion", desc = "Open inline assistant" } opts.mappings.v[prefix .. "q"] = { "CodeCompanion", desc = "Open inline assistant" } opts.mappings.v[prefix .. "a"] = { "CodeCompanionChat Add", desc = "Add selection to chat" } -- Expand cc to CodeCompanion in cmdline mode vim.cmd [[cab cc CodeCompanion]] end, }, { "AstroNvim/astroui", opts = { icons = { CodeCompanion = "󱙺" } } }, }, event = "User AstroFile", cmd = { "CodeCompanion", "CodeCompanionActions", "CodeCompanionChat", "CodeCompanionCmd", }, opts = { strategies = { chat = { adapter = "mistral", }, inline = { adapter = "mistral", }, }, }, }, { "MeanderingProgrammer/render-markdown.nvim", optional = true, opts = function(_, opts) if not opts.file_types then opts.file_types = { "markdown" } end opts.file_types = require("astrocore").list_insert_unique(opts.file_types, { "codecompanion" }) end, }, }