Neovim/lua/plugins/lualine.lua

115 lines
4.1 KiB
Lua

local icons = require("lazyvim.config").icons
return {
{
"nvim-lualine/lualine.nvim",
opts = {
options = {
theme = 'auto',
icons_enabled = true,
globalstatus = true,
section_separators = { left = '', right = '' },
component_separators = { left = ' ', right = ' ' },
disabled_filetypes = {
statusline = {
'help',
'startify',
'dashboard',
'qf',
},
winbar = {
'help',
'startify',
'dashboard',
'packer',
'neogitstatus',
'NvimTree',
'neo-tree',
'Trouble',
'alpha',
'lir',
'Outline',
'spectre_panel',
'toggleterm',
'qf',
}
},
},
sections = {
lualine_a = { 'mode' },
lualine_b = {
{
'branch',
on_click = function(_, _)
vim.defer_fn(function()
vim.cmd("LazyGit")
end, 100)
end
}
},
lualine_c = {
{
'diff',
symbols = {
added = '+',
modified = '~',
removed = '-',
},
colored = true,
on_click = function(_, _)
vim.defer_fn(function()
vim.cmd("Gitsigns diffthis")
end, 100)
end
},
{
"diagnostics",
sources = { 'nvim_diagnostic' },
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
},
colored = true,
on_click = function(_, _)
require("trouble").toggle({ mode = "document_diagnostics" })
end
},
{
'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
}
},
},
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' },
},
},
dependencies = {
'nvim-tree/nvim-web-devicons',
"SmiteshP/nvim-navic",
'kdheepak/lazygit.nvim'
}
},
}