fix: correct frecency picker invocation in dashboard and key mappings
This commit is contained in:
+2
-2
@@ -24,7 +24,7 @@ M.alpha = {
|
|||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
dashboard.section.buttons.val = {
|
dashboard.section.buttons.val = {
|
||||||
---@diagnostic disable: param-type-mismatch
|
---@diagnostic disable: param-type-mismatch
|
||||||
dashboard.button("f", " " .. " Find file", "<cmd>Telescope frecency workspace=CWD <cr>"),
|
dashboard.button("f", " " .. " Find file", [[<cmd>lua require("data.func").frecency_picker() <cr>]]),
|
||||||
dashboard.button("n", " " .. " New file", [[<cmd> ene <BAR> startinsert <cr>]]),
|
dashboard.button("n", " " .. " New file", [[<cmd> ene <BAR> startinsert <cr>]]),
|
||||||
dashboard.button("r", " " .. " Recent files", LazyVim.pick("oldfiles")),
|
dashboard.button("r", " " .. " Recent files", LazyVim.pick("oldfiles")),
|
||||||
dashboard.button("g", " " .. " Grep text", LazyVim.pick("live_grep")),
|
dashboard.button("g", " " .. " Grep text", LazyVim.pick("live_grep")),
|
||||||
@@ -51,7 +51,7 @@ M.alpha = {
|
|||||||
M.dashboard_nvim = {
|
M.dashboard_nvim = {
|
||||||
choices = {
|
choices = {
|
||||||
{ -- Find File
|
{ -- Find File
|
||||||
action = "lua LazyVim.pick()()",
|
action = 'lua require("data.func".frecency_picker()()',
|
||||||
desc = " Find File",
|
desc = " Find File",
|
||||||
icon = " ",
|
icon = " ",
|
||||||
key = "f",
|
key = "f",
|
||||||
|
|||||||
@@ -515,6 +515,19 @@ function M.dump_buffer_to_table(register)
|
|||||||
vim.fn.setreg(register, output)
|
vim.fn.setreg(register, output)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@function Function to open the frecency picker
|
||||||
|
---@return nil
|
||||||
|
function M.frecency_picker()
|
||||||
|
-- Trigger the picker
|
||||||
|
require("telescope").extensions.frecency.frecency()
|
||||||
|
-- Remove `A` character that is added by the picker
|
||||||
|
vim.api.nvim_feedkeys(
|
||||||
|
vim.api.nvim_replace_termcodes("<BS>", true, true, true),
|
||||||
|
"n",
|
||||||
|
false
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
---@function Function to reload the user's Neovim configuration
|
---@function Function to reload the user's Neovim configuration
|
||||||
---@return nil
|
---@return nil
|
||||||
function M.reload_config()
|
function M.reload_config()
|
||||||
|
|||||||
+3
-1
@@ -415,7 +415,9 @@ M.misc = {
|
|||||||
},
|
},
|
||||||
{ -- Telescope Frecency
|
{ -- Telescope Frecency
|
||||||
lhs = "<leader><leader>",
|
lhs = "<leader><leader>",
|
||||||
rhs = "<cmd>Telescope frecency workspace=CWD<cr>",
|
rhs = function()
|
||||||
|
require("data.func").frecency_picker()
|
||||||
|
end,
|
||||||
desc = "Telescope frecency",
|
desc = "Telescope frecency",
|
||||||
},
|
},
|
||||||
{ -- Exit Neovim
|
{ -- Exit Neovim
|
||||||
|
|||||||
Reference in New Issue
Block a user