I am using “fd” as my fd tool in my command line. I want to enable the use of “fd” in neovim instead of the normal “find” command in neovim. I have installed fd in my plugins with my package manager and am using the latest neovim nightly, but does seem get the fd" command working in neovim instead of “find”
Yo, this command instruction is gonna help my plugin. I always wanted to use a s: function as a custom complete function, but I never knew how. I always tried -complete=customlist,s:CompleteFd. Now I know why it didn’t work.
You could try the following snippet if using init.lua. It uses a global function, because AFAIK there’s no way to use a Lua local function for command completion.
function _G.complete_fd(arglead, cmdline, cursorpos)
local cmd = "fd -t f -g '" .. arglead .. "'"
local results = vim.fn.systemlist(cmd)
return results
end
vim.api.nvim_exec([[
command! -nargs=1 -complete=customlist,v:lua.complete_fd FD execute 'edit' <f-args>
]], false)