diff --git a/v2/nvim/lua/nairovim/plugins/lualine.lua b/v2/nvim/lua/nairovim/plugins/lualine.lua index 09797cb..ee1ba9b 100644 --- a/v2/nvim/lua/nairovim/plugins/lualine.lua +++ b/v2/nvim/lua/nairovim/plugins/lualine.lua @@ -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", @@ -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", @@ -31,7 +87,9 @@ return { }, }, extensions = { - Blank, --[[ Git_Branch ]] + -- Blank, --[[ Git_Branch ]] + MCP_Info, + Blank, }, -- options = { theme = "grubbox" }, }) diff --git a/v2/nvim/lua/nairovim/plugins/snacks.lua b/v2/nvim/lua/nairovim/plugins/snacks.lua index 86ab6af..dd28be2 100644 --- a/v2/nvim/lua/nairovim/plugins/snacks.lua +++ b/v2/nvim/lua/nairovim/plugins/snacks.lua @@ -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", }, {