Skip to content

Feature request: additional_arguments as a function #51

@coffebar

Description

@coffebar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions