diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 63a8e1b1..9ee3eb03 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -133,6 +133,7 @@ return { { "", Util.telescope("files"), desc = "Find Files (root dir)" }, -- find { "fb", "Telescope buffers", desc = "Buffers" }, + { "fc", Util.telescope.config_files(), desc = "Find Config File" }, { "ff", Util.telescope("files"), desc = "Find Files (root dir)" }, { "fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" }, { "fr", "Telescope oldfiles", desc = "Recent" }, diff --git a/lua/lazyvim/plugins/extras/ui/alpha.lua b/lua/lazyvim/plugins/extras/ui/alpha.lua index 875c11c8..8feee188 100644 --- a/lua/lazyvim/plugins/extras/ui/alpha.lua +++ b/lua/lazyvim/plugins/extras/ui/alpha.lua @@ -27,9 +27,9 @@ return { 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", " e $MYVIMRC "), + dashboard.button("c", " " .. " Config", " lua require('lazyvim.util').telescope.config_files()() "), dashboard.button("s", " " .. " Restore Session", [[ lua require("persistence").load() ]]), - dashboard.button("e", " " .. " Lazy Extras", " LazyExtras "), + dashboard.button("x", " " .. " Lazy Extras", " LazyExtras "), dashboard.button("l", "󰒲 " .. " Lazy", " Lazy "), dashboard.button("q", " " .. " Quit", " qa "), } diff --git a/lua/lazyvim/plugins/extras/ui/mini-starter.lua b/lua/lazyvim/plugins/extras/ui/mini-starter.lua index 887db7ef..5f5ec9c5 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("init.lua", "e $MYVIMRC", "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", "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"), }, content_hooks = { starter.gen_hook.adding_bullet(pad .. "░ ", false), diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index abba7d44..0707fb5b 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -1,3 +1,5 @@ +local Util = require("lazyvim.util") + return { -- Better `vim.notify()` { @@ -25,7 +27,6 @@ return { }, init = function() -- when noice is not enabled, install notify on VeryLazy - local Util = require("lazyvim.util") if not Util.has("noice.nvim") then Util.on_very_lazy(function() vim.notify = require("notify") @@ -118,7 +119,6 @@ return { lualine_require.require = require local icons = require("lazyvim.config").icons - local Util = require("lazyvim.util") vim.o.laststatus = vim.g.lualine_laststatus @@ -360,9 +360,9 @@ return { { action = "ene | startinsert", desc = " New file", icon = " ", key = "n" }, { action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" }, { action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" }, - { action = "e $MYVIMRC", desc = " Config", icon = " ", key = "c" }, + { action = Util.telescope.config_files(), desc = " Config", icon = " ", key = "c" }, { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, - { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "e" }, + { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, { action = "qa", desc = " Quit", icon = " ", key = "q" }, }, diff --git a/lua/lazyvim/util/telescope.lua b/lua/lazyvim/util/telescope.lua index 68916341..1d816b80 100644 --- a/lua/lazyvim/util/telescope.lua +++ b/lua/lazyvim/util/telescope.lua @@ -50,4 +50,8 @@ function M.telescope(builtin, opts) end end +function M.config_files() + return Util.telescope("find_files", { cwd = vim.fn.stdpath("config") }) +end + return M