Neovim/lua/plugins/lualine.lua

186 lines
7.6 KiB
Lua
Raw Permalink Normal View History

2023-11-17 11:24:21 +00:00
return {
{
"nvim-lualine/lualine.nvim",
2024-02-23 18:23:02 +00:00
opts = function()
local options = require("options")
2024-02-23 18:23:02 +00:00
return {
options = {
2024-08-16 17:24:09 +00:00
theme = options.ui.theme,
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
globalstatus = true,
2024-03-01 17:57:06 +00:00
},
sections = {
lualine_a = {
{
function()
return ""
end,
separator = { left = "", right = "" },
padding = 1,
fmt = function(text)
return string.gsub(text, "%s+", "")
end,
},
{
"mode",
padding = 0,
fmt = function(text)
return string.gsub(text, "%s+", "") .. " "
end,
},
2024-02-23 18:23:02 +00:00
},
lualine_b = {
2024-05-21 21:32:07 +00:00
{
function()
return ''
end,
padding = 0,
on_click = function()
vim.defer_fn(function()
vim.cmd("ToggleTerm direction=horizontal")
end, 100)
end
},
{
function()
return ' 󰒲 '
end,
padding = 0,
on_click = function()
vim.defer_fn(function()
vim.cmd("Lazy")
end, 100)
end
},
{
function()
return ''
end,
padding = 0,
on_click = function()
vim.defer_fn(function()
vim.cmd("Mason")
end, 100)
end
},
{
function()
return ' 󰛖 '
end,
padding = 0,
on_click = function()
vim.defer_fn(
function()
vim.lsp.buf.format()
end, 100
)
end
2024-05-24 16:42:20 +00:00
}
},
lualine_c = {
{
"branch",
icon = "󰊤",
2024-05-16 22:30:15 +00:00
on_click = function()
vim.defer_fn(function()
vim.cmd("Telescope git_branches")
end, 100)
end,
},
{
"diff",
symbols = {
added = "+",
modified = "~",
removed = "-",
},
on_click = function()
vim.defer_fn(function()
vim.cmd("Gitsigns diffthis")
end, 100)
end,
},
{
"diagnostics",
symbols = {
error = options.lsp.icons.Error,
warn = options.lsp.icons.Warn,
info = options.lsp.icons.Info,
hint = options.lsp.icons.Hint,
},
sources = {
"nvim_diagnostic",
},
update_in_insert = true,
on_click = function()
vim.defer_fn(function()
vim.cmd("TroubleToggle")
end, 100)
end,
2024-08-16 17:24:09 +00:00
},
'%=',
{
"filename",
path = 4,
symbols = {
modified = "", -- Text to show when the file is modified.
readonly = "", -- Text to show when the file is non-modifiable or readonly.
unnamed = "", -- Text to show for unnamed buffers.
newfile = "[New]", -- Text to show for newly created file before first write
},
},
2024-05-21 21:32:07 +00:00
},
lualine_x = {
{
function()
local client_id = vim.lsp.get_client_by_id(1)
return "" .. client_id.name
end,
on_click = function()
vim.defer_fn(function()
vim.cmd("LspInfo")
end, 100)
end,
color = "lualine_c_inactive",
2023-11-17 11:24:21 +00:00
},
{
"filetype",
colored = true,
on_click = function(_, _)
vim.defer_fn(function()
vim.cmd("Telescope filetypes")
end, 100)
end,
2024-02-23 18:23:02 +00:00
},
"encoding",
"fileformat",
2024-02-23 18:23:02 +00:00
},
lualine_y = {
{ "progress" },
2024-03-15 17:29:30 +00:00
},
lualine_z = { "location" },
2023-11-27 22:37:34 +00:00
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {
{
"filename",
symbols = {
modified = "", -- Text to show when the file is modified.
readonly = "", -- Text to show when the file is non-modifiable or readonly.
unnamed = "", -- Text to show for unnamed buffers.
newfile = "[New]", -- Text to show for newly created file before first write
},
},
},
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
2024-02-25 17:12:48 +00:00
},
2024-02-23 18:23:02 +00:00
}
end,
},
2023-11-17 11:24:21 +00:00
}