Newer command that doesn't have the issue
Current (since 0.8.2) version of the binding is this:
nnoremap ,c :write | edit $MYVIFMRC | restart<cr>
It also accounts for 'vicmd'
option, so is a better choice.
What's wrong with the old one
Another way of getting it fixed is to use %n
macro to suppress using terminal multiplexer like this:
nnoremap ,c :write | execute ':!vim $MYVIFMRC %n' | restart<cr>
The reason it's needed is that environment variables are passed from process parents to their children and in the case of terminal multiplexers they are the parents. There are ways to change their environment too, but since it can potentially affect too many unrelated processes, only selected variables are propagated this way.
When :edit
is used, vifm does the expansion locally and shell gets expanded path, but with :execute !...
command is passed to terminal multiplexer without expansion of environment variables and it's done on their side where there is no $MYVIFMRC
as you've discovered.