snacks.nvim/lua
Zhou Fang bd6ee23546
feat(picker): add toggle_regex for grep (#1594)
## For people who want to use it NOW!

Use `init` to hack the latest version before this PR merge.
```lua
{
  "folke/snacks.nvim",
  init = function()
    local sources = require("snacks.picker.config.sources")
    sources.grep.toggles = {
      regex = { value = true },
    }
    sources.grep.win = {
      input = {
        keys = {
          ["<a-r>"] = { "toggle_regex", mode = { "n", "i" }, desc = "Toggle Regex" },
        },
      },
    }
  end,
},
```


## Description

This PR adds a new keymap `<a-r>` for toggling the regex in grep picker.

It allows user to get faster when searching some special strings like
`$props()`, or just put a part of line `test to jump faster.

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots


https://github.com/user-attachments/assets/2442b21c-898f-4682-a966-5a82abdd23e8

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-10-20 15:52:54 +02:00
..
snacks feat(picker): add toggle_regex for grep (#1594) 2025-10-20 15:52:54 +02:00
trouble/sources Revert "feat: test" 2025-02-14 22:13:38 +01:00