I've recently installed vim text editor on my Windows. I've looked for any explanation about the location of vimrc file on Google, but I couldn't find any meaningful explanation. Where can I find vimrc file ?
I've recently installed vim text editor on my Windows. I've looked for any explanation about the location of vimrc file on Google, but I couldn't find any meaningful explanation. Where can I find vimrc file ?
From :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. Example:
:!mkdir $HOME/vimfiles
:e $HOME/vimfiles/vimrc
I gather, from your interactions, that you can run vim. But want to create a vimrc file on Windows.
The easiest way is to follow the steps -
I had great trouble writing this out, and had to fix it 3 times. The colon brings up the command line on both vi and vim. Read about using vi and vim somewhere. The \ character needs escaping by typing the \ character twice. This is my first answer in 40 years on stack overflow. I am writing this on my windows laptop, sitting on my bed.
It depends on how you got vim on your computer.
I have a generic answer instead - create a vimrc file in your user's home directory, it's probably the "correct" answer as well.