Location of my .vimrc file in Ubuntu 14.04

linux, ubuntu, vim

Solution

`:help $MYVIMRC` clearly states:

The $MYVIMRC environment variable is set to the file that was first found, unless $MYVIMRC was already set and when using VIMINIT.

So you can use that to open an existing Vim configuration, but not to create it. If you watch closely, you'll see that

:e $MYVIMRC
:w

will respond with

"$MYVIMRC" [New File]

So, you've created a file named `$MYVIMRC` in the current directory (as the variable hasn't been set).

To create an empty `.vimrc`, just use

:e $HOME/.vimrc

Since this is a one-time action, all this worrying about the right approach isn't really helpful, anyway.

Problem

I am working on a newly installed Ubuntu system. I created a my vimrc by typing vim and the then I did :e $MYVIMRC. I landed up in an empty file, I wrote something this ``` " Add full file path to your existing statusline set statusline+=%F ``` But even after that if I am opening vimrc again by using :e $MYVIMRC its not showing up anything on top as file location path.

Original source