如何在带有路径环境变量的插入模式下遍历带有 vim 文件名完成的目录?

How to Traverse directories with vim file name completion in insert mode with path environment variables?

假设我有这样的路径,

$MYDIR/filename.txt

如何自动完成文件名?

CTRL-X CTRL-F 在插入模式下只对绝对和相对路径执行此操作。有没有办法让 vim 也考虑环境变量?

我认为必须考虑两个选项:

 " it allows vim to search everywhere in your folder
 :set path+=.,**    
 " it allows you temporarelly leve the current file even if it is not saved yet
 :set hidden

这在 vim..

中默认有效