Where is .vimrc located when using Bash on Windows? I'm trying to add settings to make Bash on Windows suitable for vim use and to allow performing git diff/merge, etc. with custom settings, i.e., ignore whitespace.
Asked
Active
Viewed 2.8k times
10
-
Mine is just included in my home folder /home/isaac/.vimrc by default. – isaacsloan Mar 13 '17 at 22:00
3 Answers
27
Use vim --version | grep vimrc
to find it.
For me its
- System wide file: "/etc/vimrc"
- User file: "$HOME/.vimrc"
- Second user file: "~/.vim/vimrc"
-
Excellent, I didn't realize that the vim --version command provided so much additional info. One strange thing though: on my machine, there isn't actually a .vimrc file in those locations. I simply created one after navigating to the directory though, so all looks good now. Thanks! – JTW Mar 13 '17 at 19:54
-
1if you use gitBash on windows-10, vimrc will be in `C:\Program Files\Git\etc` – christianbueno.1 Sep 05 '19 at 16:17
8
This will edit your vimrc in the current window
:e $MYVIMRC
This will reload your vimrc after you've saved your changes
:source $MYVIMRC
This will configure two shortcuts that edit and reload your vimrc
Pressing \e in normal mode will edit your vimrc in a split window. Pressing \s will reload vimrc to apply your changes
let mapleader="\\"
nnoremap <leader>e :vsplit $MYVIMRC<cr>
nnoremap <leader>s :source $MYVIMRC<cr>
Reference

Jim U
- 3,318
- 1
- 14
- 24