Skip to content
Discussion options

You must be logged in to vote

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" },
	},

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by folke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants