Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Up-to-date Fedora 19, when I launch tmux and at the bash prompt and type:

echo $HOME

my $HOME environment variable is displayed. If I then launch vim (with and without --noplugin -U none) and type:

:echo $HOME

my $HOME environment variable is NOT displayed.

What configuration should I change so that vim knows about $HOME?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Try adding

export HOME

to your ~/.bashrc.

share|improve this answer
Yes, thank you, this seems to resolve my issue. I'm not sure I understand why this helps. Can you explain it? $HOME does seem to be set, as revealed by echo $HOME at the bash prompt. – John Schmitt Aug 8 '13 at 13:06
When bash is run, it sets the values of several environment variables including HOME. When bash runs a command in a new environment, that new environment inherits much of the environment of the parent shell, but only the definitions of those variables that were marked for export. In your case, HOME was not marked for export so its definition was not included in the environment created for vim. Bash defines HOME for itself, so the value is always available at a shell prompt. – garyjohn Aug 8 '13 at 14:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.