breaking: Remove setup script and use chezmoi

This commit is contained in:
js0ny 2025-09-27 02:25:06 +01:00
parent 02bbb24cac
commit 0051a163c3
190 changed files with 118 additions and 3456 deletions

View file

@ -0,0 +1,141 @@
local M = {}
local colors = require("config.colors")
local icons = require("config.icons")
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
M.mode = {
function()
return ""
end,
-- color = mode_color_bg,
}
M.git = {
"branch",
icon = icons.git.Branch,
color = { fg = colors.scheme.violet, gui = "bold" },
}
M.diagnostics = {
"diagnostics",
sources = { "nvim_diagnostic" },
symbols = {
error = icons.diagnostics.Error .. " ",
warn = icons.diagnostics.Warning .. " ",
info = icons.diagnostics.Information .. " ",
hint = icons.diagnostics.Hint .. " ",
},
}
M.lsp = {
-- Lsp server name .
function()
local msg = "LSP Inactive"
local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = 0 })
local clients = vim.lsp.get_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end,
icon = icons.lsp,
color = { fg = colors.scheme.yellow, gui = "italic" },
}
M.filetype = {
function()
return vim.bo.filetype
end,
color = { fg = colors.scheme.blue, gui = "bold" },
}
M.eol = {
function()
return vim.bo.eol == true and icons.eol or ""
end,
color = { fg = colors.scheme.red },
}
M.command = {
"command",
color = { fg = colors.scheme.green, gui = "bold" },
}
M.encoding = {
"o:encoding",
color = { fg = colors.scheme.green, gui = "bold" },
}
M.indent = {
function()
local shiftwidth = vim.api.nvim_get_option_value("shiftwidth", { buf = 0 })
return icons.indent .. " " .. shiftwidth
end,
padding = 1,
}
M.diff = {
"diff",
source = diff_source,
-- symbols = { added = " ", modified = "󰝤 ", removed = " " },
symbols = {
added = icons.git.Add .. " ",
modified = icons.git.Change .. " ",
removed = icons.git.Delete .. " ",
},
padding = { left = 2, right = 1 },
diff_color = {
added = { fg = colors.scheme.green },
modified = { fg = colors.scheme.yellow },
removed = { fg = colors.scheme.red },
},
cond = nil,
}
M.progress = {
"progress",
}
-- TODO: Implement orgmode
M.orgmode = {
function()
return _G.orgmode.statusline()
end,
}
-- local conditions = {
-- buffer_not_empty = function()
-- return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
-- end,
-- hide_in_width = function()
-- return vim.fn.winwidth(0) > 80
-- end,
-- check_git_workspace = function()
-- local filepath = vim.fn.expand("%:p:h")
-- local gitdir = vim.fn.finddir(".git", filepath .. ";")
-- return gitdir and #gitdir > 0 and #gitdir < #filepath
-- end,
-- }
-- local mode_color = colors.mode
--
-- local mode_color_bg = function()
-- return { fg = colors.mantle, bg = mode_color[vim.fn.mode()] }
-- end
return M

View file

@ -0,0 +1,63 @@
local lualine = require("lualine")
-- Color table for highlights
-- local colors = require("config.colors")
local components = require("plugins.mod.lualine.components")
--[[
VSCode Style:
Remote | Git Branch | Diagnostics | Command | | MID | | Line:Column | Indent | Encoding | EOL | File Type LSP | Notifications
--]]
-- Config
local config = {
options = {
disabled_filetypes = {
statusline = { "NvimTree", "alpha", "grug-far", "snacks_dashboard" },
},
-- Disable sections and component separators
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
-- theme = "catppuccin",
theme = vim.g.colors_name,
-- IDE-like Global Status
globalstaus = true,
},
sections = {
-- these are to remove the defaults
lualine_a = {
components.mode,
},
lualine_b = {
components.diff,
},
lualine_c = {
components.diagnostics,
},
lualine_x = {
components.orgmode,
components.indent,
components.encoding,
components.eol,
},
lualine_y = {
components.filetype,
components.lsp,
},
lualine_z = {
components.progress,
},
},
inactive_sections = {
-- these are to remove the defaults
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
},
}
lualine.setup(config)