telescope-egrepify.nvim icon indicating copy to clipboard operation
telescope-egrepify.nvim copied to clipboard

Better defaults for vimgrep_arguments

Open dlvhdr opened this issue 1 year ago • 1 comments

I had the --fixed-strings option set under telescope's defaults.vimgrep_arguments and couldn't figure out why egrepify wasn't working correctly with the AND operator. Fixed it by running it with:

        require("telescope").extensions.egrepify.egrepify({
          vimgrep_arguments = {
            "rg",
            "--color=never",
            "--no-heading",
            "--with-filename",
            "--line-number",
            "--column",
            "--smart-case",
            "--hidden",
            "--trim", -- add this value
          },
        })

Suggestions

  • Maybe include something about vimgrep_arguments in the readme
  • Maybe read the vimgrep_arguments passed to telescope and show a warning if they are set incorrectly

Awesome plugin! <3

dlvhdr avatar Jan 12 '24 18:01 dlvhdr

Awesome plugin! <3

Glad you like it!

I had the --fixed-strings option set under telescope's defaults.vimgrep_arguments and couldn't figure out why egrepify wasn't working correctly with the AND operator. Fixed it by running it with:

Let me decompose your issue a bit so I get this right (for, apologies, laziness to go and test all of this myself)

  • You have --fixed-strings, which causes issues with how AND operator works, correct?
  • You fixed this with --trim which removes leading whitespaces
  • --trim might generally be a good addition

Maybe read the vimgrep_arguments passed to telescope and show a warning if they are set incorrectly

Not sure I follow. The vimgrep arguments from telescope should already be inherited? And setting it in the egrepify config hopefully correctly overrides that? That is, you can maintain vimgrep config for both telescope and egrepify, respectively, if you wanted to.

Maybe include something about vimgrep_arguments in the readme

Happy to have more documentation. PR welcome :)

fdschmidt93 avatar Feb 23 '24 07:02 fdschmidt93