I'm now using
silent! let l:status = system(l:command . ' > /dev/null') if match(l:status, '\cunknown') != -1 || match(l:status, '\cnot') != -1 echo 'command not found' return 0`enter code here` endif i know it's not complete but is there any better way to check?
edit
i'm now using
silent! let l:status = system('which espeak') if l:status !~ '\w\+' echo 'command not found' return 0 endif edit
changed from which to command https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then
command -v <command name> >/dev/nulland check the exit code.whichbetter? i'm using fish and i just fundcommand -vin bash iscommand -sin fish, butwhichis all the samewhichonly works on external utilities, so not shell builtins.