From b5a3aa4dab905a4a94f37b33ead86fa355675c4b Mon Sep 17 00:00:00 2001 From: Manuuurino <2855338+manuuurino@users.noreply.github.com> Date: Tue, 2 Jul 2024 10:38:00 +0200 Subject: [PATCH] feat(codeium-nvim): use `astroui` for the symbols (#1076) --- .../completion/codeium-nvim/init.lua | 79 +++++++++++-------- 1 file changed, 48 insertions(+), 31 deletions(-) diff --git a/lua/astrocommunity/completion/codeium-nvim/init.lua b/lua/astrocommunity/completion/codeium-nvim/init.lua index b8996902c..05c080133 100644 --- a/lua/astrocommunity/completion/codeium-nvim/init.lua +++ b/lua/astrocommunity/completion/codeium-nvim/init.lua @@ -7,40 +7,57 @@ return { enable_chat = true, }, dependencies = { - "AstroNvim/astrocore", - ---@param opts AstroCoreOpts - opts = { - mappings = { - n = { - [";"] = { - name = " Codeium", - }, - [";o"] = { - desc = "Open Chat", - function() vim.cmd "Codeium Chat" end, - }, + { + "AstroNvim/astroui", + ---@type AstroUIOpts + opts = { + icons = { + Codeium = "", }, }, }, + { + "AstroNvim/astrocore", + ---@param opts AstroCoreOpts + opts = function(_, opts) + return require("astrocore").extend_tbl(opts, { + mappings = { + n = { + [";"] = { + name = require("astroui").get_icon("Codeium", 1, true) .. "Codeium", + }, + [";o"] = { + desc = "Open Chat", + function() vim.cmd "Codeium Chat" end, + }, + }, + }, + }) + end, + }, + }, + { + "hrsh7th/nvim-cmp", + optional = true, + dependencies = { "Exafunction/codeium.nvim" }, + opts = function(_, opts) + -- Inject codeium into cmp sources, with high priority + table.insert(opts.sources, 1, { + name = "codeium", + group_index = 1, + priority = 10000, + }) + end, + }, + { + "onsails/lspkind.nvim", + optional = true, + -- Adds icon for codeium using lspkind + opts = function(_, opts) + opts.symbol_map = { + Codeium = require("astroui").get_icon("Codeium", 1, true), + } + end, }, - }, - { - "hrsh7th/nvim-cmp", - optional = true, - dependencies = { "Exafunction/codeium.nvim" }, - opts = function(_, opts) - -- Inject codeium into cmp sources, with high priority - table.insert(opts.sources, 1, { - name = "codeium", - group_index = 1, - priority = 10000, - }) - end, - }, - { - "onsails/lspkind.nvim", - optional = true, - -- Adds icon for codeium using lspkind - opts = function(_, opts) opts.symbol_map = { Codeium = "" } end, }, }