I have functions defined in a file that is sourced by my .bashrc file (shown below). The command is found just fine from the bash command line, and also when I execute a subshell and use the command. Within a vim session however, the function foo is not found when I execute a bang command. How do I make the foo function visible to the bang command?
foofile:
printf "%s\n" "here I am in foofile"
function foo () {
printf "%s\n" "Here I am in function foo. Love ya ma!"
}
export foo
(in vim)
:!foo
/bin/bash: foo: command not found
shell returned 127