I use vim\'s :! external command function all the time, usually providing % as an argument to the shell command. For example :
:!psql -f %
Export your functions. That is:
psql-h1() { /usr/bin/psql -hh1 -d mydb "$@"; } export -f psql-h1 ### <-- THIS RIGHT HERE
This will make them available to any copy of bash run as a child process, even if it's a noninteractive shell and so doesn't read .bashrc.
.bashrc