65 lines
1.9 KiB
Lua
65 lines
1.9 KiB
Lua
local function lsp_names()
|
|
local names = vim.tbl_map(function(c)
|
|
return c.name
|
|
end, vim.lsp.get_clients({ bufnr = 0 }))
|
|
return table.concat(names, ",")
|
|
end
|
|
|
|
local function agent_marker()
|
|
if not package.loaded["sidekick"] then
|
|
return ""
|
|
end
|
|
local ok, sessions = pcall(function()
|
|
return require("sidekick.status").cli()
|
|
end)
|
|
return (ok and sessions and #sessions > 0) and "agent" or ""
|
|
end
|
|
|
|
return {
|
|
{
|
|
"nvim-mini/mini.icons",
|
|
lazy = true,
|
|
opts = {},
|
|
init = function()
|
|
-- Plugins that ask for nvim-web-devicons (mini.tabline, oil) get mini.icons instead.
|
|
package.preload["nvim-web-devicons"] = function()
|
|
require("mini.icons").mock_nvim_web_devicons()
|
|
return package.loaded["nvim-web-devicons"]
|
|
end
|
|
end,
|
|
},
|
|
{
|
|
"nvim-mini/mini.tabline",
|
|
lazy = false,
|
|
dependencies = { "nvim-mini/mini.icons" },
|
|
opts = { tabpage_section = "none" },
|
|
},
|
|
{
|
|
"nvim-mini/mini.statusline",
|
|
lazy = false,
|
|
config = function()
|
|
local sl = require("mini.statusline")
|
|
sl.setup({
|
|
content = {
|
|
active = function()
|
|
local mode, mode_hl = sl.section_mode({ trunc_width = 120 })
|
|
local git = sl.section_git({ trunc_width = 40 })
|
|
local diagnostics = sl.section_diagnostics({ trunc_width = 75 })
|
|
local filename = sl.section_filename({ trunc_width = 140 })
|
|
local location = sl.section_location({ trunc_width = 75 })
|
|
return sl.combine_groups({
|
|
{ hl = mode_hl, strings = { mode } },
|
|
{ hl = "MiniStatuslineDevinfo", strings = { git, diagnostics } },
|
|
"%<",
|
|
{ hl = "MiniStatuslineFilename", strings = { filename } },
|
|
"%=",
|
|
{ hl = "MiniStatuslineFileinfo", strings = { agent_marker(), lsp_names() } },
|
|
{ hl = mode_hl, strings = { location } },
|
|
})
|
|
end,
|
|
},
|
|
})
|
|
end,
|
|
},
|
|
}
|