88 lines
1.9 KiB
Lua
88 lines
1.9 KiB
Lua
return {
|
|
"nvim-lualine/lualine.nvim",
|
|
event = "VeryLazy",
|
|
depends = {
|
|
"nvim-tree/nvim-web-devicons",
|
|
},
|
|
opts = function()
|
|
local icons = require("aleidk.constants").icons
|
|
-- local Util = require("lazyvim.util")
|
|
--
|
|
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
|
|
|
|
return {
|
|
options = {
|
|
theme = "auto",
|
|
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 },
|
|
{
|
|
"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,
|
|
},
|
|
},
|
|
},
|
|
lualine_x = {
|
|
{ "require'lsp-status'.status()" },
|
|
},
|
|
lualine_y = {
|
|
{ "location", padding = 0 },
|
|
{
|
|
"progress",
|
|
fmt = position_scrollbar,
|
|
separator = " ",
|
|
padding = 0,
|
|
},
|
|
},
|
|
lualine_z = {},
|
|
},
|
|
extensions = { "neo-tree", "lazy" },
|
|
}
|
|
end,
|
|
}
|