How to locate the vimrc file used by vim editor?

VimCommandConfiguration Files

Vim Problem Overview


Is there a command in the vim editor to find the .vimrc file location?

Vim Solutions


Solution 1 - Vim

Just try doing the following:

:version

You will get an output which includes something like:

 system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"

As noted by Herbert in comments, this is where vim looks for vimrcs, it doesn't mean they exist.

You can check the full path of your vimrc with

:echo $MYVIMRC

If the output is empty, then your vim doesn't use a user vimrc (just create it if you wish).

Solution 2 - Vim

:version does not list /etc/vim but this is where vim is picking up gvimrc and vimrc on my ubuntu box running vim82 from vim-gtk3

Solution 3 - Vim

For nvim use :scriptnames like proposed in Randy Morris comment

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionniting112View Question on Stackoverflow
Solution 1 - VimmanojldsView Answer on Stackoverflow
Solution 2 - VimJeremy WoodlandView Answer on Stackoverflow
Solution 3 - VimmickoursView Answer on Stackoverflow