add base setup with dotter
This commit is contained in:
parent
6b0da868bb
commit
42e6595b60
177 changed files with 1062 additions and 70 deletions
230
config/nvim/lua/aleidk/plugins/lualine.lua
Normal file
230
config/nvim/lua/aleidk/plugins/lualine.lua
Normal file
|
|
@ -0,0 +1,230 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
lazy = false,
|
||||
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
|
||||
if gitsigns then
|
||||
return {
|
||||
added = gitsigns.added,
|
||||
modified = gitsigns.changed,
|
||||
removed = gitsigns.removed,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
local function position_scrollbar(str)
|
||||
local sbar = { "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" }
|
||||
|
||||
local curr_line = vim.api.nvim_win_get_cursor(0)[1]
|
||||
local lines = vim.api.nvim_buf_line_count(0)
|
||||
local i = math.floor((curr_line - 1) / lines * #sbar) + 1
|
||||
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 = "catppuccin",
|
||||
globalstatus = true,
|
||||
disabled_filetypes = { statusline = { "dashboard", "alpha" } },
|
||||
component_separators = "",
|
||||
section_separators = "",
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
{
|
||||
"mode",
|
||||
padding = 0,
|
||||
fmt = function()
|
||||
return " "
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{ "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",
|
||||
},
|
||||
{
|
||||
-- Macro recording status
|
||||
function()
|
||||
return require("noice").api.status.mode.get()
|
||||
end,
|
||||
cond = function()
|
||||
return package.loaded["noice"] and require("noice").api.status.mode.has()
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
function()
|
||||
return require("grapple").statusline()
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
{ "searchcount" },
|
||||
{ "location" },
|
||||
{
|
||||
"progress",
|
||||
fmt = position_scrollbar,
|
||||
separator = " ",
|
||||
padding = 0,
|
||||
},
|
||||
},
|
||||
lualine_z = {},
|
||||
},
|
||||
winbar = {
|
||||
lualine_b = {
|
||||
{
|
||||
"filename",
|
||||
path = 1,
|
||||
symbols = {
|
||||
modified = " ●", -- Text to show when the buffer is modified
|
||||
alternate_file = "#", -- Text to show to identify the alternate file
|
||||
directory = "", -- Text to show when the buffer is a directory
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = icons.git.added,
|
||||
modified = icons.git.modified,
|
||||
removed = icons.git.removed,
|
||||
},
|
||||
source = diff_source,
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = icons.diagnostics.Error,
|
||||
warn = icons.diagnostics.Warn,
|
||||
info = icons.diagnostics.Info,
|
||||
hint = icons.diagnostics.Hint,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
inactive_winbar = {
|
||||
lualine_b = {
|
||||
{
|
||||
"filename",
|
||||
path = 1,
|
||||
symbols = {
|
||||
modified = " ●", -- Text to show when the buffer is modified
|
||||
alternate_file = "#", -- Text to show to identify the alternate file
|
||||
directory = "", -- Text to show when the buffer is a directory
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = icons.git.added,
|
||||
modified = icons.git.modified,
|
||||
removed = icons.git.removed,
|
||||
},
|
||||
source = diff_source,
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = icons.diagnostics.Error,
|
||||
warn = icons.diagnostics.Warn,
|
||||
info = icons.diagnostics.Info,
|
||||
hint = icons.diagnostics.Hint,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
"neo-tree",
|
||||
"lazy",
|
||||
"fugitive",
|
||||
"fzf",
|
||||
"man",
|
||||
"mason",
|
||||
"nvim-tree",
|
||||
"quickfix",
|
||||
"symbols-outline",
|
||||
"trouble",
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue