简体   繁体   English

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

[英]Where can I find vimrc file in Windows?

I've recently installed vim text editor on my Windows.我最近在 Windows 上安装了 vim 文本编辑器。 I've looked for any explanation about the location of vimrc file on Google, but I couldn't find any meaningful explanation.我已经在 Google 上寻找有关 vimrc 文件位置的任何解释,但找不到任何有意义的解释。 Where can I find vimrc file ?我在哪里可以找到 vimrc 文件?

From :h vimrc :来自: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.

However, Vim will not create a vimrc file for you automatically, you will need to create it yourself.但是,Vim 不会自动为您创建vimrc文件,您需要自己创建它。 Example:例子:

:!mkdir $HOME/vimfiles
:e $HOME/vimfiles/vimrc

It depends on how you got vim on your computer.这取决于您如何在计算机上安装vim

I have a generic answer instead - create a vimrc file in your user's home directory, it's probably the "correct" answer as well.我有一个通用的答案 - 在您用户的主目录中创建一个vimrc文件,这也可能是“正确”的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM