Neovim/lua/plugins/lualine.lua

115 lines
4.1 KiB
Lua
Raw Normal View History

2023-11-17 11:24:21 +00:00
local icons = require("lazyvim.config").icons
return {
{
"nvim-lualine/lualine.nvim",
opts = {
options = {
2024-01-02 22:44:49 +00:00
theme = 'auto',
2023-11-17 11:24:21 +00:00
icons_enabled = true,
globalstatus = true,
section_separators = { left = '', right = '' },
component_separators = { left = ' ', right = ' ' },
2023-11-17 11:24:21 +00:00
disabled_filetypes = {
statusline = {
'help',
'startify',
'dashboard',
2023-11-27 22:37:34 +00:00
'qf',
},
winbar = {
'help',
'startify',
'dashboard',
'packer',
'neogitstatus',
'NvimTree',
'neo-tree',
'Trouble',
'alpha',
'lir',
'Outline',
'spectre_panel',
'toggleterm',
2023-11-17 11:24:21 +00:00
'qf',
}
},
2023-11-27 22:37:34 +00:00
},
sections = {
lualine_a = { 'mode' },
lualine_b = {
{
2023-11-17 11:24:21 +00:00
'branch',
2023-11-27 22:37:34 +00:00
on_click = function(_, _)
vim.defer_fn(function()
vim.cmd("LazyGit")
end, 100)
end
}
},
lualine_c = {
{
'diff',
symbols = {
added = '+',
modified = '~',
removed = '-',
2023-11-17 11:24:21 +00:00
},
2023-11-27 22:37:34 +00:00
colored = true,
on_click = function(_, _)
vim.defer_fn(function()
vim.cmd("Gitsigns diffthis")
2023-11-27 22:37:34 +00:00
end, 100)
end
},
{
"diagnostics",
sources = { 'nvim_diagnostic' },
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
2023-11-17 11:24:21 +00:00
},
2023-11-27 22:37:34 +00:00
colored = true,
on_click = function(_, _)
require("trouble").toggle({ mode = "document_diagnostics" })
end
2023-11-17 11:24:21 +00:00
},
2023-11-27 22:37:34 +00:00
{
'filename',
file_status = true,
path = 0,
symbols = {
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
2023-11-17 11:24:21 +00:00
}
},
2023-11-27 22:37:34 +00:00
},
lualine_x = {
'encoding',
'fileformat',
{
'filetype',
colored = true,
on_click = function(_, _)
vim.defer_fn(function()
vim.cmd("Telescope filetypes")
end, 100)
end
}
},
lualine_y = { 'progress' },
lualine_z = { 'location' },
},
2023-11-17 11:24:21 +00:00
},
dependencies = {
2023-11-27 22:37:34 +00:00
'nvim-tree/nvim-web-devicons',
"SmiteshP/nvim-navic",
'kdheepak/lazygit.nvim'
2023-11-17 11:24:21 +00:00
}
},
}