Can't open a file in sublime text using bash_rc
The st function which is working when you type st is an old one which you defined interactively within Terminal.
If you enter:

type st


you will see that this definition is not the one you entered within your
.bash_profile.

To execute the definition entered within your .bash_profile, you have to load it within your actual shell:

. ~/.bash_profile


or

source ~/.bash_profile


And you will be able to check that from now on your definition of your st function is correct with:

type st