Neovim/lua/plugins/lualine.lua

134 lines
5.0 KiB
Lua
Raw 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')
return {
2023-11-17 11:24:21 +00:00
options = {
2024-02-23 18:23:02 +00:00
theme = "vscode",
component_separators = { left = '', right = '' },
2024-03-01 17:57:06 +00:00
section_separators = { left = '', right = '' },
globalstatus = true
2023-11-27 22:37:34 +00:00
},
sections = {
2024-02-23 18:23:02 +00:00
lualine_a = {
2024-03-01 17:57:06 +00:00
{
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
},
2023-11-27 22:37:34 +00:00
lualine_b = {
2024-03-01 17:57:06 +00:00
{
'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_c = {
2023-11-27 22:37:34 +00:00
{
2023-11-17 11:24:21 +00:00
'branch',
2024-03-03 20:02:51 +00:00
icon = '󰊤'
2024-02-23 18:23:02 +00:00
},
2023-11-27 22:37:34 +00:00
{
'diff',
symbols = {
added = '+',
modified = '~',
removed = '-',
2024-03-15 17:29:30 +00:00
},
on_click = function ()
vim.defer_fn(function()
vim.cmd("Gitsigns diffthis")
end, 100)
end,
2024-03-01 17:57:06 +00:00
},
2024-02-25 17:12:48 +00:00
},
2024-03-01 17:57:06 +00:00
lualine_x = {
2024-03-15 17:29:30 +00:00
{
function ()
local client_id = vim.lsp.get_client_by_id(1)
return ' LSP ~ ' .. client_id.name
end,
on_click = function ()
vim.defer_fn(function()
vim.cmd("LspInfo")
end, 100)
end,
color = 'lualine_c_inactive'
},
2023-11-27 22:37:34 +00:00
{
2024-02-23 18:23:02 +00:00
'diagnostics',
2023-11-27 22:37:34 +00:00
symbols = {
2024-02-23 18:23:02 +00:00
error = options.lsp.icons.Error,
warn = options.lsp.icons.Warn,
info = options.lsp.icons.Info,
hint = options.lsp.icons.Hint,
2023-11-17 11:24:21 +00:00
},
2024-02-23 18:23:02 +00:00
sources = {
'nvim_diagnostic'
},
2024-03-15 17:29:30 +00:00
update_in_insert = true,
2024-02-23 18:23:02 +00:00
on_click = function ()
vim.defer_fn(function()
2024-03-15 17:29:30 +00:00
vim.cmd("TroubleToggle")
2024-02-23 18:23:02 +00:00
end, 100)
2024-03-15 17:29:30 +00:00
end,
2024-02-23 18:23:02 +00:00
},
2023-11-27 22:37:34 +00:00
{
'filetype',
colored = true,
on_click = function(_, _)
vim.defer_fn(function()
vim.cmd("Telescope filetypes")
end, 100)
end
2024-03-15 17:29:30 +00:00
},
'encoding',
'fileformat'
},
lualine_y = {
{ 'progress' }
2023-11-27 22:37:34 +00:00
},
2024-02-23 18:23:02 +00:00
lualine_z = {'location'}
2023-11-27 22:37:34 +00:00
},
2024-02-23 18:23:02 +00:00
inactive_sections = {
lualine_a = {},
lualine_b = {},
2024-02-25 17:12:48 +00:00
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
}
}
},
2024-02-23 18:23:02 +00:00
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
}
2023-11-17 11:24:21 +00:00
}
2024-02-23 18:23:02 +00:00
end
}
2023-11-17 11:24:21 +00:00
}
2024-03-01 17:57:06 +00:00