I want to change this VimScript to lua, but I don't know how to check if an executable exists.
if executable('curl')
In this case I can just use the executable function defined by vim. But I want to know how would I do it without using vim's function.
local fn = vim.fn
local function executable(ex)
return fn.executable(ex) == 1
end
I can search recursively for a file with that name in the path and if it exists and is executable I return true, else I return false.
Is there an easier way to make a function that checks if the executable exists and returns a boolean?