External commands are not executed in an interactive shell so your .bash_profile
is not read. To make your custom command available you must turn that it into an actual shell script, put it in your $PATH
, and make it executable:
#!/usr/bin/env bash
echo "Hello world!"
But there's a much better way to "compile something": :help :make
.