Neovim/lua/plugins/lualine.lua

91 lines
3.2 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 = '' },
2023-11-27 22:37:34 +00:00
},
sections = {
2024-02-23 18:23:02 +00:00
lualine_a = {
'mode',
},
2023-11-27 22:37:34 +00:00
lualine_b = {
{
2023-11-17 11:24:21 +00:00
'branch',
2024-02-23 18:23:02 +00:00
},
2023-11-27 22:37:34 +00:00
{
'diff',
symbols = {
added = '+',
modified = '~',
removed = '-',
2024-02-23 18:23:02 +00:00
}
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'
},
update_in_insert = true
}
},
lualine_c = {
2023-11-27 22:37:34 +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.
2024-02-23 18:23:02 +00:00
unnamed = '', -- Text to show for unnamed buffers.
newfile = '[New]', -- Text to show for newly created file before first write
2023-11-17 11:24:21 +00:00
}
2024-02-23 18:23:02 +00:00
}
2023-11-27 22:37:34 +00:00
},
lualine_x = {
2024-02-23 18:23:02 +00:00
{
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
},
2023-11-27 22:37:34 +00:00
'encoding',
'fileformat',
{
'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
lualine_y = {'progress'},
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 = {},
lualine_c = {'filename'},
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
}