tweak display options

This commit is contained in:
2024-11-21 14:33:43 -05:00
parent 266e296bd6
commit c93d3b53f4
+121 -95
View File
@@ -1,99 +1,125 @@
return { return {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
dependencies = { dependencies = {
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
"rmehri01/onenord.nvim", "rmehri01/onenord.nvim",
}, },
config = function() config = function()
local lualine = require "lualine" local lualine = require("lualine")
local lazy_status = require "lazy.status" local lazy_status = require("lazy.status")
lualine.setup { local custom_components = {
options = { encoding = function()
icons_enabled = true, local ret, _ = (vim.bo.fenc or vim.go.enc):gsub("^utf%-8$", "")
theme = "onenord", return ret
component_separators = { left = "", right = "" }, end,
section_separators = { left = "", right = "" },
disabled_filetypes = { fileformat = function()
statusline = { "alpha", "dashboard", "Outline" }, local ret, _ = vim.bo.fileformat:gsub("^unix$", "")
winbar = {}, return ret
end,
}
local function gitsigns_diff()
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 = {
icons_enabled = true,
theme = "onenord",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = { "alpha", "dashboard", "Outline" },
winbar = {},
},
ignore_focus = { "NvimTree" },
always_divide_middle = true,
always_show_tabline = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
},
},
sections = {
lualine_a = { "mode" },
lualine_b = {
{
"filename",
file_status = true,
newfile_status = true,
path = 4,
symbols = {
modified = "[+]",
readonly = "[-]",
}, },
ignore_focus = { "NvimTree" }, },
always_divide_middle = true, },
always_show_tabline = true, lualine_c = {
globalstatus = false, "branch",
refresh = { -- TODO: make it prettier...
statusline = 1000, { "b:gitsigns_head", icon = "" },
tabline = 1000, { "diff", source = gitsigns_diff },
winbar = 1000, },
}, lualine_x = {
}, -- TODO: spell indicator (when on)
sections = { -- TODO: LSP
lualine_a = { "mode" }, {
lualine_b = { "diagnostics",
{ sources = { "nvim_workspace_diagnostic" },
"filename", sections = { "error", "warn", "info", "hint" },
file_status = true, --symbols = { error = " ", warn = " ", info = " ", hint = "󰠠 " },
newfile_status = true, colored = true,
path = 4, always_visible = false,
symbols = { },
modified = "[+]", {
readonly = "[-]", lazy_status.updates,
}, cond = lazy_status.has_updates,
}, color = { fg = "#ebcb8b" },
}, },
lualine_c = { -- {
"branch", -- function()
"diff", -- return require("auto-session.lib").current_session_name(true)
"b:gitsigns_status", -- end,
}, -- },
lualine_x = { { custom_components.encoding },
{ { custom_components.fileformat },
"diagnostics", "filetype",
sources = { "nvim_workspace_diagnostic" }, },
sections = { "error", "warn", "info", "hint" }, lualine_y = { "searchcount", "progress" },
--symbols = { error = " ", warn = " ", info = " ", hint = "󰠠 " }, lualine_z = { "selectioncount", "location" },
colored = true, },
always_visible = false, inactive_sections = {
}, lualine_a = {},
{ lualine_b = {},
lazy_status.updates, lualine_c = { "filename" },
cond = lazy_status.has_updates, lualine_x = {
color = { fg = "#ebcb8b" }, {
}, "diagnostics",
-- { sources = { "nvim_lsp", "nvim_workspace_diagnostic", "nvim_diagnostic" },
-- function() sections = { "error", "warn", "info", "hint" },
-- return require("auto-session.lib").current_session_name(true) --symbols = { error = " ", warn = " ", info = " ", hint = "󰠠 " },
-- end, colored = false,
-- }, always_visible = false,
"encoding", },
"fileformat", },
"filetype", lualine_y = {},
}, lualine_z = { "location" },
lualine_y = { "searchcount", "progress" }, },
lualine_z = { "selectioncount", "location" }, tabline = {},
}, winbar = {},
inactive_sections = { inactive_winbar = {},
lualine_a = {}, extensions = { "nvim-tree", "lazy", "trouble", "quickfix", "fzf", "mason" },
lualine_b = {}, })
lualine_c = { "filename" }, end,
lualine_x = {
{
"diagnostics",
sources = { "nvim_lsp", "nvim_workspace_diagnostic", "nvim_diagnostic" },
sections = { "error", "warn", "info", "hint" },
--symbols = { error = " ", warn = " ", info = " ", hint = "󰠠 " },
colored = false,
always_visible = false,
},
},
lualine_y = {},
lualine_z = { "location" },
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = { "nvim-tree", "lazy", "trouble", "quickfix", "fzf", "mason" },
}
end,
} }