Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Vim: Location of vimrc

📅 2012-Jun-24 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Problem

Users of Vim use the vimrc file for settings that they want to be applied whenever an instance of the editor is launched. If you are sitting at the computer of a friend and using his Vim, how do you find out the location of the vimrc that was used to launch his editor?

Solution

The path of the vimrc file that used to launch an instance of vim is stored in the environment variable named $MYVIMRC. The value stored in this variable can be viewed using :echo $MYVIMRC

Tried with: Vim 7.3 on Windows 7 64-bit