The mycommand is a function in my lib/work.sh file.
cat .bashrc
source /home/lib/work.sh
It means that mycommand was sourced in automatically.
mycommand can execute in terminal.
Now to edit a file with vim test.txt,shift+" to enter into vim's command mode ,input !mycommand ,
/bin/bash: mycommand: command not found
shell returned 127
Press ENTER or type command to continue
Why mycommand can't found in vim?