enable color for copilot lualine
This commit is contained in:
parent
03701f3616
commit
19567ee2b5
@ -1,137 +1,137 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = function()
|
||||
local M = require("lualine.component"):extend()
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = function()
|
||||
local M = require("lualine.component"):extend()
|
||||
|
||||
M.processing = false
|
||||
M.spinner_index = 1
|
||||
M.processing = false
|
||||
M.spinner_index = 1
|
||||
|
||||
local spinner_symbols = {
|
||||
"⠋",
|
||||
"⠙",
|
||||
"⠹",
|
||||
"⠸",
|
||||
"⠼",
|
||||
"⠴",
|
||||
"⠦",
|
||||
"⠧",
|
||||
"⠇",
|
||||
"⠏",
|
||||
}
|
||||
local spinner_symbols_len = 10
|
||||
local spinner_symbols = {
|
||||
"⠋",
|
||||
"⠙",
|
||||
"⠹",
|
||||
"⠸",
|
||||
"⠼",
|
||||
"⠴",
|
||||
"⠦",
|
||||
"⠧",
|
||||
"⠇",
|
||||
"⠏",
|
||||
}
|
||||
local spinner_symbols_len = 10
|
||||
|
||||
-- Initializer
|
||||
function M:init(options)
|
||||
M.super.init(self, options)
|
||||
-- Initializer
|
||||
function M:init(options)
|
||||
M.super.init(self, options)
|
||||
|
||||
local group = vim.api.nvim_create_augroup("CodeCompanionHooks", {})
|
||||
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
|
||||
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 M:update_status()
|
||||
if self.processing then
|
||||
self.spinner_index = (self.spinner_index % spinner_symbols_len) + 1
|
||||
return spinner_symbols[self.spinner_index]
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
-- Function that runs every time statusline is updated
|
||||
function M:update_status()
|
||||
if self.processing then
|
||||
self.spinner_index = (self.spinner_index % spinner_symbols_len) + 1
|
||||
return spinner_symbols[self.spinner_index]
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "catppuccin",
|
||||
-- theme = 'dracula',
|
||||
-- theme = 'horizon',
|
||||
-- theme = 'onedark',
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {},
|
||||
always_divide_middle = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = {
|
||||
M,
|
||||
{
|
||||
"copilot",
|
||||
symbols = {
|
||||
status = {
|
||||
icons = {
|
||||
enabled = " ",
|
||||
sleep = " ", -- auto-trigger disabled
|
||||
disabled = " ",
|
||||
warning = " ",
|
||||
unknown = " ",
|
||||
},
|
||||
hl = {
|
||||
enabled = "#50FA7B",
|
||||
sleep = "#AEB7D0",
|
||||
disabled = "#6272A4",
|
||||
warning = "#FFB86C",
|
||||
unknown = "#FF5555",
|
||||
},
|
||||
},
|
||||
spinners = "dots", -- has some premade spinners
|
||||
spinner_color = "#6272A4",
|
||||
},
|
||||
show_colors = false,
|
||||
show_loading = true,
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
"fileformat",
|
||||
symbols = {
|
||||
unix = "", -- e712
|
||||
dos = "", -- e70f
|
||||
mac = "", -- e711
|
||||
},
|
||||
},
|
||||
"encoding",
|
||||
"fileformat",
|
||||
{ "filetype", colored = true, icon_only = false },
|
||||
},
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
file_status = true, -- Displays file status (readonly status, modified status)
|
||||
path = 0, -- 0: Just the filename
|
||||
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
|
||||
symbols = {
|
||||
modified = "[+]", -- Text to show when the file is modified.
|
||||
readonly = "[-]", -- Text to show when the file is non-modifiable or readonly.
|
||||
unnamed = "[No Name]", -- Text to show for unnamed buffers.
|
||||
},
|
||||
},
|
||||
M,
|
||||
},
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = { "quickfix", "fzf", "nvim-tree", "symbols-outline", "fugitive" },
|
||||
})
|
||||
end,
|
||||
depends = { "kyazdani42/nvim-web-devicons" },
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "catppuccin",
|
||||
-- theme = 'dracula',
|
||||
-- theme = 'horizon',
|
||||
-- theme = 'onedark',
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {},
|
||||
always_divide_middle = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = {
|
||||
M,
|
||||
{
|
||||
"copilot",
|
||||
symbols = {
|
||||
status = {
|
||||
icons = {
|
||||
enabled = " ",
|
||||
sleep = " ", -- auto-trigger disabled
|
||||
disabled = " ",
|
||||
warning = " ",
|
||||
unknown = " ",
|
||||
},
|
||||
hl = {
|
||||
enabled = "#50FA7B",
|
||||
sleep = "#AEB7D0",
|
||||
disabled = "#6272A4",
|
||||
warning = "#FFB86C",
|
||||
unknown = "#FF5555",
|
||||
},
|
||||
},
|
||||
spinners = "dots", -- has some premade spinners
|
||||
spinner_color = "#6272A4",
|
||||
},
|
||||
show_colors = true,
|
||||
show_loading = true,
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
"fileformat",
|
||||
symbols = {
|
||||
unix = "", -- e712
|
||||
dos = "", -- e70f
|
||||
mac = "", -- e711
|
||||
},
|
||||
},
|
||||
"encoding",
|
||||
"fileformat",
|
||||
{ "filetype", colored = true, icon_only = false },
|
||||
},
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
file_status = true, -- Displays file status (readonly status, modified status)
|
||||
path = 0, -- 0: Just the filename
|
||||
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
|
||||
symbols = {
|
||||
modified = "[+]", -- Text to show when the file is modified.
|
||||
readonly = "[-]", -- Text to show when the file is non-modifiable or readonly.
|
||||
unnamed = "[No Name]", -- Text to show for unnamed buffers.
|
||||
},
|
||||
},
|
||||
M,
|
||||
},
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = { "quickfix", "fzf", "nvim-tree", "symbols-outline", "fugitive" },
|
||||
})
|
||||
end,
|
||||
depends = { "kyazdani42/nvim-web-devicons" },
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user