Add copilot configs for nvim and zed
This commit is contained in:
parent
a3804e67a5
commit
3fc3675808
9 changed files with 197 additions and 209 deletions
|
|
@ -4,9 +4,11 @@ return {
|
|||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"cbochs/grapple.nvim",
|
||||
{ 'AndreM222/copilot-lualine' }
|
||||
},
|
||||
opts = function()
|
||||
local icons = require("aleidk.constants").icons
|
||||
local palete = require("catppuccin.palettes").get_palette "macchiato"
|
||||
|
||||
local function diff_source()
|
||||
local gitsigns = vim.b.gitsigns_status_dict
|
||||
|
|
@ -28,9 +30,45 @@ return {
|
|||
return str .. " " .. sbar[i]
|
||||
end
|
||||
|
||||
local codecompanion_status = require("lualine.component"):extend()
|
||||
|
||||
codecompanion_status.processing = false
|
||||
codecompanion_status.spinner_index = 1
|
||||
|
||||
local spinner_symbols = require("copilot-lualine.spinners").bouncing_bar
|
||||
|
||||
-- Initializer
|
||||
function codecompanion_status:init(options)
|
||||
codecompanion_status.super.init(self, options)
|
||||
|
||||
local group = vim.api.nvim_create_augroup("CodeCompanionHooks", {})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "User" }, {
|
||||
pattern = "CodeCompanionRequest*",
|
||||
group = group,
|
||||
callback = function(request)
|
||||
if request.match == "CodeCompanionRequestStarted" then
|
||||
self.processing = true
|
||||
elseif request.match == "CodeCompanionRequestFinished" then
|
||||
self.processing = false
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- Function that runs every time statusline is updated
|
||||
function codecompanion_status:update_status()
|
||||
if self.processing then
|
||||
self.spinner_index = (self.spinner_index % #spinner_symbols) + 1
|
||||
return spinner_symbols[self.spinner_index]
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
options = {
|
||||
theme = "auto",
|
||||
theme = "catppuccin",
|
||||
globalstatus = true,
|
||||
disabled_filetypes = { statusline = { "dashboard", "alpha" } },
|
||||
component_separators = "",
|
||||
|
|
@ -48,7 +86,35 @@ return {
|
|||
},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{ "branch", icon = icons.git.branch },
|
||||
{ "branch", icon = icons.git.branch },
|
||||
{
|
||||
"copilot",
|
||||
cond = function()
|
||||
return vim.bo.filetype ~= "codecompanion"
|
||||
end,
|
||||
show_colors = true,
|
||||
symbols = {
|
||||
status = {
|
||||
icons = {
|
||||
enabled = " ",
|
||||
sleep = " ", -- auto-trigger disabled
|
||||
disabled = " ",
|
||||
warning = " ",
|
||||
unknown = " "
|
||||
},
|
||||
hl = {
|
||||
enabled = palete.teal,
|
||||
sleep = palete.lavender,
|
||||
disabled = palete.subtext0,
|
||||
warning = palete.peach,
|
||||
unknown = palete.red
|
||||
}
|
||||
},
|
||||
spinners = spinner_symbols,
|
||||
spinner_color = palete.mauve
|
||||
},
|
||||
},
|
||||
{ codecompanion_status },
|
||||
{
|
||||
"overseer",
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue