diff --git a/lua/lazyvim/plugins/extras/util/project.lua b/lua/lazyvim/plugins/extras/util/project.lua index 5d399125..01a25bc2 100644 --- a/lua/lazyvim/plugins/extras/util/project.lua +++ b/lua/lazyvim/plugins/extras/util/project.lua @@ -152,6 +152,9 @@ return { "nvimdev/dashboard-nvim", optional = true, opts = function(_, opts) + if not vim.tbl_get(opts, "config", "center") then + return + end local projects = { action = pick, desc = " Projects", @@ -165,4 +168,17 @@ return { table.insert(opts.config.center, 3, projects) end, }, + + { + "folke/snacks.nvim", + optional = true, + opts = function(_, opts) + table.insert(opts.dashboard.preset.keys, 3, { + action = pick, + desc = "Projects", + icon = " ", + key = "p", + }) + end, + }, } diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index d52c6741..866e2ba9 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -319,17 +319,19 @@ return { ███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║ ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]], - ---@param keys snacks.dashboard.Item[] - keys = function(keys) - -- add LazyExtra before Lazy - for k, key in ipairs(keys) do - if key.action == ":Lazy" then - key.key = "l" -- we don't have multiple panes, so `l` is free - table.insert(keys, k, { icon = " ", desc = "Lazy Extras", action = ":LazyExtras", key = "x" }) - break - end - end - end, + -- stylua: ignore + ---@type snacks.dashboard.Item[] + keys = { + { icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" }, + { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, + { icon = " ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" }, + { icon = " ", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" }, + { icon = " ", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" }, + { icon = " ", key = "s", desc = "Restore Session", section = "session" }, + { icon = " ", key = "x", desc = "Lazy Extras", action = ":LazyExtras" }, + { icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy" }, + { icon = " ", key = "q", desc = "Quit", action = ":qa" }, + }, }, }, },