feat: add find_command option for find_files (#73)

This commit is contained in:
TimUntersberger
2020-09-14 00:13:46 +02:00
committed by GitHub
parent 3d423a3b59
commit 0a734ae49d

View File

@@ -366,7 +366,9 @@ end
builtin.find_files = function(opts)
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
find_command = { 'fd', '--type', 'f' }
elseif 1 == vim.fn.executable("fdfind") then
@@ -374,6 +376,7 @@ builtin.find_files = function(opts)
elseif 1 == vim.fn.executable("rg") then
find_command = { 'rg', '--files' }
end
end
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 :)")