Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 61 additions & 3 deletions v2/nvim/lua/nairovim/plugins/lualine.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,54 @@
-- local config = lualine.get_config();
----------------------------------------------------------------------
-- MCP Hub Status Component (Reusable)
----------------------------------------------------------------------
local mcp_status_component = {
function()
-- Check if MCPHub is loaded
if not vim.g.loaded_mcphub then
return "󰐻 -"
end

local count = vim.g.mcphub_servers_count or 0
local status = vim.g.mcphub_status or "stopped"
local executing = vim.g.mcphub_executing

-- Show "-" when stopped
if status == "stopped" then
return "󰐻 -"
end

-- Show spinner when executing, starting, or restarting
if executing or status == "starting" or status == "restarting" then
local frames = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }
local frame = math.floor(vim.loop.now() / 100) % #frames + 1
return "󰐻 " .. frames[frame]
end

return "󰐻 " .. count
end,
color = function()
if not vim.g.loaded_mcphub then
return { fg = "#6c7086" } -- Gray for not loaded
end

local status = vim.g.mcphub_status or "stopped"
if status == "ready" or status == "restarted" then
return { fg = "#50fa7b" } -- Green for connected
elseif status == "starting" or status == "restarting" then
return { fg = "#ffb86c" } -- Orange for connecting
else
return { fg = "#ff5555" } -- Red for error/stopped
end
end,
}

----------------------------------------------------------------------
-- Extension Configurations
----------------------------------------------------------------------
local Blank = {
sections = { lualine_a = { "" } },
sections = {
lualine_a = { "" },
},
filetypes = {
"packer",
"filetree",
Expand All @@ -13,6 +61,14 @@ local Blank = {
"AvanteSelectedFiles",
},
}

local MCP_Info = {
sections = {
lualine_a = { "" },
lualine_x = { mcp_status_component },
},
filetypes = { "Avante" },
}
-- local Git_Branch = { sections = { lualine_b = { "branch" }, lualine_y = { "progress" } }, filetypes = { "NvimTree" } }
return {
"nvim-lualine/lualine.nvim",
Expand All @@ -31,7 +87,9 @@ return {
},
},
extensions = {
Blank, --[[ Git_Branch ]]
-- Blank, --[[ Git_Branch ]]
MCP_Info,
Blank,
},
-- options = { theme = "grubbox" },
})
Expand Down
2 changes: 1 addition & 1 deletion v2/nvim/lua/nairovim/plugins/snacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Hey there! Welcome. Enjoy a focused dev experience with NairoVIM.
{
icon = " ",
key = "A",
desc = "Avante - (GitHub Copilot)",
desc = "Avante AI - (GitHub Copilot)",
action = ":AvanteFocus",
},
{
Expand Down