在 Windows 中哪里可以找到 vimrc 文件?

Nav*_*mar 10 windows vim

我最近在 Windows 上安装了 vim 文本编辑器。我在 Google 上查找了有关 vimrc 文件位置的任何解释,但找不到任何有意义的解释。在哪里可以找到 vimrc 文件?

Pet*_*ker 9

:h vimrc

Places for your personal initializations:
    Unix        $HOME/.vimrc or $HOME/.vim/vimrc
    MS-Windows  $HOME/_vimrc, $HOME/vimfiles/vimrc
            or $VIM/_vimrc
    Amiga       s:.vimrc, home:.vimrc, home:vimfiles:vimrc
            or $VIM/.vimrc

The files are searched in the order specified above and only the first
one that is found is read.

RECOMMENDATION: Put all your Vim configuration stuff in the
$HOME/.vim/ directory ($HOME/vimfiles/ for MS-Windows). That makes it
easy to copy it to another system.
Run Code Online (Sandbox Code Playgroud)

但是,Vim 不会vimrc自动为您创建文件,您需要自己创建。例子:

:!mkdir $HOME/vimfiles
:e $HOME/vimfiles/vimrc
Run Code Online (Sandbox Code Playgroud)


小智 2

这取决于您如何进入vim计算机。

我有一个通用答案 -vimrc在用户的主目录中创建一个文件,它也可能是“正确”的答案。