From 339979d3143d46a37c304d45a00c7a4f448e707d Mon Sep 17 00:00:00 2001 From: Calvin Bochulak Date: Wed, 12 Jun 2024 22:09:30 -0600 Subject: [PATCH] fix(ui): use `LazyVim.pick` for alpha.nvim and mini.starter extras (#3611) ## What is this PR for? Make other nvim dashboards use LazyVim.pick so they can also make use of fzf-lua when the extra is enabled. In addition, aligned the sections to be the same as dashboard.nvim. **Note**: this is somewhat untested. I haven't tested each dashboard and their sections to make sure they all work. ## Does this PR fix an existing issue? ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> --- lua/lazyvim/plugins/extras/ui/alpha.lua | 10 +++++----- lua/lazyvim/plugins/extras/ui/mini-starter.lua | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/alpha.lua b/lua/lazyvim/plugins/extras/ui/alpha.lua index 8feee188..1898bd08 100644 --- a/lua/lazyvim/plugins/extras/ui/alpha.lua +++ b/lua/lazyvim/plugins/extras/ui/alpha.lua @@ -23,11 +23,11 @@ return { dashboard.section.header.val = vim.split(logo, "\n") -- stylua: ignore dashboard.section.buttons.val = { - dashboard.button("f", " " .. " Find file", " Telescope find_files "), - dashboard.button("n", " " .. " New file", " ene startinsert "), - dashboard.button("r", " " .. " Recent files", " Telescope oldfiles "), - dashboard.button("g", " " .. " Find text", " Telescope live_grep "), - dashboard.button("c", " " .. " Config", " lua require('lazyvim.util').telescope.config_files()() "), + dashboard.button("f", " " .. " Find file", LazyVim.pick()), + dashboard.button("n", " " .. " New file", [[ ene startinsert ]]), + dashboard.button("r", " " .. " Recent files", LazyVim.pick("oldfiles")), + dashboard.button("g", " " .. " Find text", LazyVim.pick("live_grep")), + dashboard.button("c", " " .. " Config", LazyVim.pick.config_files()), dashboard.button("s", " " .. " Restore Session", [[ lua require("persistence").load() ]]), dashboard.button("x", " " .. " Lazy Extras", " LazyExtras "), dashboard.button("l", "󰒲 " .. " Lazy", " Lazy "), diff --git a/lua/lazyvim/plugins/extras/ui/mini-starter.lua b/lua/lazyvim/plugins/extras/ui/mini-starter.lua index e6078d60..ac2f3aab 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-starter.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-starter.lua @@ -29,15 +29,15 @@ return { evaluate_single = true, header = logo, items = { - new_section("Find file", "Telescope find_files", "Telescope"), - new_section("Recent files", "Telescope oldfiles", "Telescope"), - new_section("Grep text", "Telescope live_grep", "Telescope"), - new_section("Config", "lua require('lazyvim.util').telescope.config_files()()", "Config"), - new_section("Extras", "LazyExtras", "Config"), - new_section("Lazy", "Lazy", "Config"), - new_section("New file", "ene | startinsert", "Built-in"), - new_section("Quit", "qa", "Built-in"), - new_section("Session restore", [[lua require("persistence").load()]], "Session"), + new_section("Find file", LazyVim.pick(), "Telescope"), + new_section("New file", "ene | startinsert", "Built-in"), + new_section("Recent files", LazyVim.pick("oldfiles"), "Telescope"), + new_section("Find text", LazyVim.pick("live_grep"), "Telescope"), + new_section("Config", LazyVim.pick.config_files(), "Config"), + new_section("Restore session", [[lua require("persistence").load()]], "Session"), + new_section("Lazy Extras", "LazyExtras", "Config"), + new_section("Lazy", "Lazy", "Config"), + new_section("Quit", "qa", "Built-in"), }, content_hooks = { starter.gen_hook.adding_bullet(pad .. "░ ", false),