Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: additional_arguments as a function #51

Open
coffebar opened this issue Oct 4, 2023 · 1 comment
Open

Feature request: additional_arguments as a function #51

coffebar opened this issue Oct 4, 2023 · 1 comment

Comments

@coffebar
Copy link

coffebar commented Oct 4, 2023

It would be great to get a more flexible config:

{
  name = "rg",
  keyword_length = 3,
  option = {
    additional_arguments = function(cwd)
      if vim.fn.expand(cwd) == vim.fn.expand("~") then
        return "--max-depth 6 --ignore-file ~/.config/nvim/ignore.rg"
      else
        local args = "--max-depth 3"
        if vim.fn.filereadable(vim.fn.expand(cwd .. "/.gitignore")) == 1 then
          args = args .. " --ignore-file '" .. cwd .. "/.gitignore'"
        end
        return args
      end
    end,
  },
}
@lukas-reineke
Copy link
Owner

Yeah, would be nice.
I want to do a bit of refactoring of the repo anyway. I'll add this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants