nvim/lua/plugins/lualine.lua

86 lines
2.1 KiB
Lua

return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
vim.o.showmode = false
local hide_in_width = function()
return vim.fn.winwidth(0) > 80
end
local lualine = require("lualine")
-- local spaces = function()
-- return "spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
-- end
lualine.diagnostics = {
"diagnostics",
sources = { "nvim_diagnostic" },
sections = { "error", "warn" },
-- symbols = { error = " ", warn = " " },
colored = false,
update_in_insert = false,
always_visible = false,
}
lualine.diff = {
"diff",
colored = false,
-- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
cond = hide_in_width,
}
lualine.mode = {
"mode",
fmt = function(str)
return "<" .. str:sub(1, 1) .. ">"
end,
}
lualine.filetype = {
"filetype",
icons_enabled = false,
icon = nil,
}
lualine.branch = {
"branch",
icons_enabled = true,
-- icon = "",
}
lualine.location = {
"location",
padding = 0,
}
lualine.setup({
options = {
-- theme = "nord",
-- theme = "everforest",
theme = "auto",
icons_enabled = true,
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = { "alpha", "dashboard", "NvimTree", "Outline" },
always_divide_middle = true,
},
sections = {
lualine_a = { lualine.mode },
lualine_b = { lualine.branch, "filename" },
lualine_c = {},
-- lualine_x = { "encoding", "fileformat", "filetype" },
-- lualine_x = { lualine.diff, spaces, "encoding", lualine.filetype },
lualine_x = { lualine.diagnostics, lualine.filetype },
lualine_y = { "progress", "location" },
-- lualine_z = { "tabnine" },
lualine_z = {},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
-- lualine_x = { "location" },
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
tabline = {},
extensions = {},
})
end,
}