mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 08:53:33 +02:00
feat(copilot): added lualine component for copilot. Simple icon colored by status. Will add status message when available (warnings)
This commit is contained in:
parent
4042614005
commit
d63c471008
1 changed files with 28 additions and 0 deletions
|
@ -10,6 +10,34 @@ return {
|
||||||
panel = { enabled = false },
|
panel = { enabled = false },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local Util = require("lazyvim.util")
|
||||||
|
local colors = {
|
||||||
|
[""] = Util.fg("Special"),
|
||||||
|
["Normal"] = Util.fg("Special"),
|
||||||
|
["Warning"] = Util.fg("DiagnosticWarn"),
|
||||||
|
["InProgress"] = Util.fg("DiagnosticInfo"),
|
||||||
|
}
|
||||||
|
table.insert(opts.sections.lualine_x, 2, {
|
||||||
|
function()
|
||||||
|
local icon = require("lazyvim.config").icons.kinds.Copilot
|
||||||
|
local status = require("copilot.api").status.data
|
||||||
|
return icon .. (status.message or "")
|
||||||
|
end,
|
||||||
|
cond = function()
|
||||||
|
local clients = vim.lsp.get_active_clients({ name = "copilot", bufnr = 0 })
|
||||||
|
return #clients > 0
|
||||||
|
end,
|
||||||
|
color = function()
|
||||||
|
local status = require("copilot.api").status.data
|
||||||
|
return colors[status.status] or colors[""]
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
-- copilot cmp source
|
-- copilot cmp source
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue