Files
dotfiles/.config/nvim/lua/plugins/lualine.lua
2025-09-02 03:32:47 +02:00

181 lines
4.8 KiB
Lua

return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
lazy = false,
opts = {
options = {
icons_enabled = true,
theme = "everforest",
component_separators = { left = "", right = "" },
--component_separators = { left = '', right = '' },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = false,
globalstatus = true,
refresh = {
statusline = 200,
tabline = 200,
winbar = 500,
events = {
"WinEnter",
"BufEnter",
"BufWritePost",
"SessionLoadPost",
"FileChangedShellPost",
"VimResized",
"Filetype",
"CursorMoved",
"CursorMovedI",
"ModeChanged",
},
},
symbols = {
--modified = " ●", -- Text to show when the buffer is modified
alternate_file = "#", -- Text to show to identify the alternate file
directory = "", -- Text to show when the buffer is a directory
modified = "[+]", -- Text to show when the file is modified.
readonly = "[-]", -- Text to show when the file is non-modifiable or readonly.
unnamed = "[No Name]", -- Text to show for unnamed buffers.
newfile = "[New]", -- Text to show for newly created file before first write
},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = {
-- {
-- require("noice").api.status.mode.get,
-- cond = require("noice").api.status.mode.has,
-- color = { fg = "#ff9e64" },
-- },
-- {
-- require("noice").api.status.search.get,
-- cond = require("noice").api.status.search.has,
-- color = { fg = "#ff9e64" },
-- },
"pwd",
-- { "filename", path = 3 },
},
lualine_x = {
{
require("noice").api.status.command.get,
cond = require("noice").api.status.command.has,
color = { fg = "#ff9e64" },
},
{
require("noice").api.statusline.mode.get,
cond = require("noice").api.statusline.mode.has,
color = { fg = "#ff9e64" },
},
{
require("noice").api.status.search.get,
cond = require("noice").api.status.search.has,
color = { fg = "#ff9e64" },
},
"filesize",
{
"fileformat",
symbols = {
unix = "LF",
dos = "CRLF",
},
},
"filetype",
'require"lsp-status".status()',
},
lualine_y = { "searchcount", "progress" },
lualine_z = { "selectioncount", "location" },
},
inactive_sections = {},
tabline = {
lualine_a = {
{
"tabs",
mode = 2,
path = 1,
max_length = 320,
tab_max_length = 40,
use_mode_colors = true,
},
},
lualine_b = {},
lualine_c = {},
lualine_d = {},
lualine_x = {
{
function()
if require("nvim-possession").status then
return require("nvim-possession").status()
else
end
end,
cond = function() return require("nvim-possession").status() ~= nil end,
},
},
lualine_y = { { "datetime", style = "%H:%M" } },
lualine_z = {},
},
winbar = {
lualine_a = {},
-- 0: Just the filename
-- 1: Relative path
-- 2: Absolute path
-- 3: Absolute path, with tilde as the home directory
-- 4: Filename and parent dir, with tilde as the home directory
lualine_b = { separator = nil, { "bufnr" }, { "filename", path = 3 } },
lualine_c = {
{
"diagnostics",
-- Table of diagnostic sources, available sources are:
-- 'nvim_lsp', 'nvim_diagnostic', 'nvim_workspace_diagnostic', 'coc', 'ale', 'vim_lsp'.
-- or a function that returns a table as such:
-- { error=error_cnt, warn=warn_cnt, info=info_cnt, hint=hint_cnt }
sources = { "nvim_diagnostic", "coc" },
-- Displays diagnostics for the defined severity types
sections = { "error", "warn" },
-- sections = { "error", "warn", "info", "hint" },
diagnostics_color = {
-- Same values as the general color option can be used here.
error = "DiagnosticError", -- Changes diagnostics' error color.
warn = "DiagnosticWarn", -- Changes diagnostics' warn color.
-- info = "DiagnosticInfo", -- Changes diagnostics' info color.
-- hint = "DiagnosticHint", -- Changes diagnostics' hint color.
},
symbols = { error = "E", warn = "W", info = "I", hint = "H" },
colored = true, -- Displays diagnostics status in color if set to true.
update_in_insert = false, -- Update diagnostics in insert mode.
always_visible = false, -- Show diagnostics even if there are none.
},
},
lualine_x = {
--[["filesize", "filetype"]]
},
lualine_y = {},
lualine_z = {},
},
inactive_winbar = {
lualine_a = {},
lualine_b = {},
lualine_c = {
"bufnr",
{
"filename",
path = 4,
},
},
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
extensions = {},
},
}