Skip to content
Discussion options

You must be logged in to vote

This is how I did this, again, not sure if I'm doing this correctly, but hey, it works.

sources = {
  files = {
    actions = {
      switch_to_grep = function(picker, _)
        local snacks = require("snacks")
        local pattern = picker.input.filter.pattern or picker.input.filter.search
        local cwd = picker.input.filter.cwd

        picker:close()

        ---@diagnostic disable-next-line: missing-fields
        snacks.picker.grep({ cwd = cwd, search = pattern })
      end,
    },
    win = {
      input = {
        keys = {
          ["<a-r>"] = { "switch_to_grep", desc = "Switch to grep", mode = { "i", "n" } },
        },
      },
    },
  },
  grep = {
    actions = {
      s…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@rbhanot4739
Comment options

@synic
Comment options

Answer selected by synic
Comment options

You must be logged in to vote
1 reply
@synic
Comment options

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