How to locate the vimrc file used by vim editor?

送分小仙女□ 提交于 2019-12-18 09:56:31

问题


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


回答1:


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).



来源:https://stackoverflow.com/questions/8977649/how-to-locate-the-vimrc-file-used-by-vim-editor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!