Can I use environment variables in the find file?

I would like to use environment variables in the find-file command. Something like that:

C-x C-f $ENV_VAR/foo.txt

Does find file have this functionality? What is syntax?

+3


source to share


1 answer


As Barmar said, it works as you say ... as far as you don't use ido

or the like.

Enter C-h k C-x C-fto see if you are using an extended shell for find-file

eg ido

.



If you are using ido

, you can type C-fat the prompt to temporarily return to the old search prompt, where you can type for example (to complete to $ HOME), then write something like to complete to $ HOME / .profile, etc. etc. $HO <tab>

/.pro <tab>

If you used the other one, you should check the documentation because they probably have a fallback method.

+1


source







All Articles