mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 08:35:53 +02:00
feat(snacks.picker): added support for Project shortcuts in other dashboards (#5607)
…shboard-nvim, and mini-starter ## Description Though the snacks.picker extra provides a project picker, it only adds the 'Projects' shortcut to snacks' dashboard, and no to the other three dashboard extra: alpha, dashboard-nvim and mini-starter. In this PR, I added the 'Projects' shortcuts to these three dashboard extras. <!-- Describe the big picture of your changes to communicate to the maintainers why we should accept this pull request. --> ## Related Issue(s) <!-- If this PR fixes any issues, please link to the issue here. - Fixes #<issue_number> --> - Fixes #5465 ## Screenshots <!-- Add screenshots of the changes if applicable. --> alpha  dashboard-nvim  mini.starter  ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.
This commit is contained in:
parent
e9dad45f93
commit
401ef48fcd
2 changed files with 47 additions and 0 deletions
|
@ -168,6 +168,50 @@ return {
|
|||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
optional = true,
|
||||
opts = function(_, dashboard)
|
||||
local button = dashboard.button("p", " " .. " Projects", [[<cmd> lua Snacks.picker.projects() <cr>]])
|
||||
button.opts.hl = "AlphaButtons"
|
||||
button.opts.hl_shortcut = "AlphaShortcut"
|
||||
table.insert(dashboard.section.buttons.val, 4, button)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.starter",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local items = {
|
||||
{
|
||||
name = "Projects",
|
||||
action = [[lua Snacks.picker.projects()]],
|
||||
section = string.rep(" ", 22) .. "Telescope",
|
||||
},
|
||||
}
|
||||
vim.list_extend(opts.items, items)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
if not vim.tbl_get(opts, "config", "center") then
|
||||
return
|
||||
end
|
||||
local projects = {
|
||||
action = "lua Snacks.picker.projects()",
|
||||
desc = " Projects",
|
||||
icon = " ",
|
||||
key = "p",
|
||||
}
|
||||
|
||||
projects.desc = projects.desc .. string.rep(" ", 43 - #projects.desc)
|
||||
projects.key_format = " %s"
|
||||
|
||||
table.insert(opts.config.center, 3, projects)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/flash.nvim",
|
||||
optional = true,
|
||||
|
|
|
@ -11,6 +11,9 @@ local prios = {
|
|||
-- default priority is 50
|
||||
["lazyvim.plugins.extras.editor.aerial"] = 100,
|
||||
["lazyvim.plugins.extras.editor.outline"] = 100,
|
||||
["lazyvim.plugins.extras.ui.alpha"] = 19,
|
||||
["lazyvim.plugins.extras.ui.dashboard-nvim"] = 19,
|
||||
["lazyvim.plugins.extras.ui.mini-starter"] = 19,
|
||||
}
|
||||
|
||||
if vim.g.xtras_prios then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue