dotfiles/nvim/after/plugin/lualine.lua
Nikos Papadakis e51e61ed5f
nix
2023-09-24 20:51:10 +03:00

60 lines
1.4 KiB
Lua

local ok, lualine = pcall(require, "lualine")
if not ok then
return
end
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
lualine.setup {
options = {
theme = "auto",
globalstatus = true,
section_separators = "",
},
sections = {
lualine_b = {
{ "branch" },
{
"diff",
source = diff_source,
},
},
lualine_c = {
{
"filetype",
colored = true,
icon_only = true,
separator = "",
},
{ "filename" },
{
function()
return vim.fn.search([[\s\+$]], "nw") ~= 0 and "trailing" or ""
end,
color = "WarningMsg",
},
},
lualine_x = {
{ "encoding" },
{ "fileformat" },
{
function()
if vim.bo.expandtab then
return "Space " .. vim.bo.shiftwidth
else
return "Tab " .. vim.bo.shiftwidth
end
end,
},
},
},
}