nvim/lua/user/lualine.lua

59 lines
1.2 KiB
Lua
Raw Normal View History

2022-10-12 22:07:20 -04:00
local status_ok, lualine = pcall(require, "lualine")
if not status_ok then
return
end
local hide_in_width = function()
return vim.fn.winwidth(0) > 80
end
local diagnostics = {
"diagnostics",
sources = { "nvim_diagnostic" },
sections = { "error", "warn" },
symbols = { error = "", warn = "" },
2023-04-10 09:40:46 -04:00
colored = true,
2022-10-12 22:07:20 -04:00
always_visible = true,
}
local diff = {
"diff",
2023-04-10 09:40:46 -04:00
colored = true,
symbols = { added = "", modified = "", removed = "" }, -- changes diff symbols
2022-10-12 22:07:20 -04:00
cond = hide_in_width,
}
local filetype = {
"filetype",
2023-04-10 09:40:46 -04:00
icons_enabled = true,
2022-10-12 22:07:20 -04:00
}
local location = {
"location",
2023-04-10 09:40:46 -04:00
padding = { right = 1 },
2022-10-12 22:07:20 -04:00
}
2023-04-10 09:40:46 -04:00
-- local spaces = function()
-- return "spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
-- end
2022-10-12 22:07:20 -04:00
lualine.setup {
options = {
globalstatus = true,
icons_enabled = true,
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = { "alpha", "dashboard" },
always_divide_middle = true,
},
sections = {
lualine_a = { "mode" },
lualine_b = {"branch"},
lualine_c = { diagnostics },
2023-04-10 09:40:46 -04:00
lualine_x = { diff, filetype },
2022-10-12 22:07:20 -04:00
lualine_y = { location },
lualine_z = { "progress" },
},
}