feat(nvim): add persisted.nvim entry to the dashboard

This commit is contained in:
Sergio Laín 2024-08-07 20:56:38 +02:00
parent e0f1ff7c79
commit 519427c55d
No known key found for this signature in database
GPG key ID: 8429B2EE312F8150

View file

@ -88,4 +88,28 @@ return {
},
},
},
{
"nvimdev/dashboard-nvim",
opts = function(_, opts)
-- Remove the older session plugin entry
for i, section in ipairs(opts.config.center) do
if section.key == "s" then
table.remove(opts.config.center, i)
break
end
end
local session = {
action = 'lua require("persisted").load()',
desc = " Restore Session",
icon = "",
key = "s",
}
session.desc = session.desc .. string.rep(" ", 43 - #session.desc)
session.key_format = " %s"
table.insert(opts.config.center, 9, session)
end,
},
}