feat: add find_command option for find_files (#73)
This commit is contained in:
@@ -366,7 +366,9 @@ end
|
|||||||
builtin.find_files = function(opts)
|
builtin.find_files = function(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
||||||
local find_command = nil
|
local find_command = opts.find_command
|
||||||
|
|
||||||
|
if not find_command then
|
||||||
if 1 == vim.fn.executable("fd") then
|
if 1 == vim.fn.executable("fd") then
|
||||||
find_command = { 'fd', '--type', 'f' }
|
find_command = { 'fd', '--type', 'f' }
|
||||||
elseif 1 == vim.fn.executable("fdfind") then
|
elseif 1 == vim.fn.executable("fdfind") then
|
||||||
@@ -374,6 +376,7 @@ builtin.find_files = function(opts)
|
|||||||
elseif 1 == vim.fn.executable("rg") then
|
elseif 1 == vim.fn.executable("rg") then
|
||||||
find_command = { 'rg', '--files' }
|
find_command = { 'rg', '--files' }
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if not find_command then
|
if not find_command then
|
||||||
print("You need to install either fd or rg. You can also submit a PR to add support for another file finder :)")
|
print("You need to install either fd or rg. You can also submit a PR to add support for another file finder :)")
|
||||||
|
|||||||
Reference in New Issue
Block a user