[Help] Is there a way to grep through scratch files? #1012
Answered
by
maskudo
Ajaymamtora
asked this question in
Q&A
-
Can you use .picker.grep to search through the scratch files created by the scratch module. |
Beta Was this translation helpful? Give feedback.
Answered by
maskudo
Feb 8, 2025
Replies: 1 comment
-
This works for me: {
"<leader>ssg",
function()
Snacks.picker.grep({
cwd = vim.fn.stdpath("data") .. "/scratch",
win = {
input = {
keys = {
["<CR>"] = {
"open_scratch",
desc = "Open Scratch",
mode = { "n", "i" },
},
},
},
},
actions = {
["open_scratch"] = function(picker)
local current = picker:current()._path
picker:close()
Snacks.scratch.open({ file = current })
end,
},
})
end,
desc = "Grep Scratch Buffers",
mode = { "n", "v" },
},
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
folke
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works for me: