You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

109 lines
3.7 KiB

return {
"nvim-lualine/lualine.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
"letieu/harpoon-lualine",
},
config = function()
local lualine = require("lualine")
local lazy_status = require("lazy.status")
-- Custom components
local function macro_recording()
local recording_register = vim.fn.reg_recording()
if recording_register == "" then
return ""
else
return "Recording @" .. recording_register
end
end
local function buffer_count()
local buffers = vim.fn.getbufinfo({ buflisted = 1 })
return "Buffers: " .. #buffers
end
lualine.setup({
options = {
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
globalstatus = true,
refresh = {
statusline = 1000, -- Refresh every second for macro recording
},
},
extensions = {
"fugitive",
"oil",
"quickfix",
"trouble", -- Add if you use trouble.nvim
"mason", -- Add if you use mason.nvim
},
sections = {
lualine_a = {
{ "mode", fmt = function(str) return str:sub(1,1) end }, -- Shorter mode display
},
lualine_b = {
{ "branch", icon = "" },
{
"diff",
colored = true,
symbols = { added = " ", modified = " ", removed = " " }
},
{
"diagnostics",
sources = { "nvim_lsp" },
symbols = { error = " ", warn = " ", info = " ", hint = " " }
},
},
lualine_c = {
{
"filename",
file_status = true,
path = 1, -- Show relative path
shorting_target = 40, -- Shorten long paths
symbols = {
modified = "",
readonly = "",
unnamed = "[No Name]",
newfile = "[New]",
}
},
{ "harpoon2" },
{
macro_recording,
color = { fg = "#ff9e64", gui = "bold" },
separator = { left = "" }
},
{ buffer_count, color = { fg = "#7aa2f7" } },
},
lualine_x = {
{
lazy_status.updates,
cond = lazy_status.has_updates,
color = { fg = "#ff9e64" },
},
-- Remove fileformat unless you really need it
-- { "fileformat" },
{ "filetype", colored = true },
},
lualine_y = {
{ "progress" },
},
lualine_z = {
{ "location" },
},
},
inactive_sections = {
lualine_c = {
{ "filename", file_status = true, path = 1 }
},
lualine_x = {
{ "filetype" }
},
},
})
end,
}