Files
neovim-config/lua/taken/plugins/lualine.lua
Taken 9556024c93 Added types
Signed-off-by: Taken <taken@mairimashita.org>
2024-03-17 16:34:11 +01:00

154 lines
5.0 KiB
Lua

--- @type LazyPluginSpec
return {
"nvim-lualine/lualine.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
config = function()
local lualine = require("lualine")
local colors = {
bg = "#1e1e2e",
fg = "#cdd6f4",
yellow = "#f9e2af",
cyan = "#89dceb",
darkblue = "#89b4fa",
green = "#a6e3a1",
orange = "#fab387",
violet = "#f5c2e7",
magenta = "#cba6f7",
blue = "#74c7ec",
red = "#f38ba8",
}
local conditions = {
hide_in_width = function()
return vim.fn.winwidth(0) > 80
end,
}
local mode_color = {
n = colors.red,
i = colors.green,
v = colors.blue,
[""] = colors.blue,
V = colors.blue,
c = colors.magenta,
no = colors.red,
s = colors.orange,
S = colors.orange,
[""] = colors.orange,
ic = colors.yellow,
R = colors.violet,
Rv = colors.violet,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
["r?"] = colors.cyan,
["!"] = colors.red,
t = colors.red,
}
lualine.setup({
options = {
component_separators = "",
section_separators = { left = "", right = "" },
},
sections = {
lualine_a = {
{
"mode",
separator = { left = "" },
right_padding = 2,
color = function()
return { bg = mode_color[vim.fn.mode()], fg = colors.bg }
end,
},
},
lualine_b = {
{
"filename",
color = { fg = colors.magenta, gui = "bold" },
},
{
"branch",
icon = "",
color = { fg = colors.violet, gui = "bold" },
},
},
lualine_c = {
{
"diagnostics",
sources = { "nvim_diagnostic" },
symbols = { error = "", warn = "", info = "" },
diagnostics_color = {
color_error = { fg = colors.red },
color_warn = { fg = colors.yellow },
color_info = { fg = colors.cyan },
},
},
},
lualine_x = {
{
"diff",
symbols = { added = "", modified = "󰝤 ", removed = "" },
diff_color = {
added = { fg = colors.green },
modified = { fg = colors.orange },
removed = { fg = colors.red },
},
cond = conditions.hide_in_width,
},
{
"o:encoding",
fmt = string.upper,
cond = conditions.hide_in_width,
color = { fg = colors.green, gui = "bold" },
},
{
"fileformat",
fmt = string.upper,
color = { fg = colors.green, gui = "bold" },
},
{
require("lazy.status").updates,
cond = require("lazy.status").has_updates,
color = { fg = colors.violet },
},
},
lualine_y = {
{
"filetype",
color = { fg = colors.darkblue },
},
{
"progress",
color = { fg = colors.magenta },
},
},
lualine_z = {
{
"location",
separator = { right = "" },
left_padding = 2,
color = function()
return { bg = mode_color[vim.fn.mode()], fg = colors.bg }
end,
},
},
},
inactive_sections = {
lualine_a = { "filename" },
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = { "location" },
},
tabline = {},
extensions = {},
})
end,
}