ivy.nvim/lua/ivy/backends/rg.lua
Ade Attwood 0f364c140d fix: add no require git to rg command backend
Summary:

When using this backend in a directory that is not a git repository, it will
search though all the file. This is mostly a problem when using an alternative
source control like sapling.

When using this backend neovim will just hang until the rg command is done.
When searching node_modules you can imagine how long that takes. This does not
actually fix the issue however, it does make it search though less files.

Test Plan:

This has been used manually on a sapling repo. I have also added
`--no-require-git` to most of the rg defaults in other applications.
2024-10-27 17:28:54 +00:00

12 lines
305 B
Lua

local utils = require "ivy.utils"
local rg = {
name = "RG",
command = "IvyRg",
description = "Run ripgrep to search for content in files",
keymap = "<leader>/",
items = utils.command_finder "rg --no-require-git --max-columns 200 --vimgrep --",
callback = utils.vimgrep_action(),
}
return rg