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,13 +366,16 @@ end
builtin.find_files = function(opts)
opts = opts or {}
local find_command = nil
if 1 == vim.fn.executable("fd") then
find_command = { 'fd', '--type', 'f' }
elseif 1 == vim.fn.executable("fdfind") then
find_command = { 'fdfind', '--type', 'f' }
elseif 1 == vim.fn.executable("rg") then
find_command = { 'rg', '--files' }
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
find_command = { 'fdfind', '--type', 'f' }
elseif 1 == vim.fn.executable("rg") then
find_command = { 'rg', '--files' }
end
end
if not find_command then