25

Cygwin has a home directory where I can store a .vimrc file to set up syntax highlighting. I know on linux machines this file is usually in a home directory and that it can be stored globally (although I haven't figure out how the global thing works yet).

I'm windows user (I apologize), so I use different shells for different things, and am not all too sure why syntax highlighting is not working when I launch it from the git bash shell. It works fine for cygwin and for putty. but not so much for git's mingw32.

Another thing is that when I ssh to a remote server using cygwin, I cannot use Vim, but I can use Vim just fine when I connect using Putty's shell.

Any help on this topic would be greatly appreciated.

laserface
  • 449
  • 1
  • 4
  • 12

2 Answers2

46

Git bash uses MSYSGIT, which comes with its own Vim . One way to look it up -

In your git bash type

$ type vim

it will tell you which vim executable is used. In my machine it points to

/bin/vim

if you type

vim --version, it spits out a lot of environment.

pipe it to a grep, like this

vim --version | grep vimrc and this will tell you the location(s) where this instance of vim will look for vimrc.

Srikanth Venugopalan
  • 9,011
  • 3
  • 36
  • 76
  • Ok... thanks for that info. It also is using the executable from `/bin/vim`, but the root is not really the root of my windows machine, it's the root of msysgit. I knew this before, and found a vimrc in the /etc folder which I used to copy to my home directory. When type in the grep command, it says: system vimrc file: `$VIM\vimrc;` `user vimrc file: $HOME\_vimrc;` `2nd user vimrc file: $VIM\_vimrc`. All of these files have the same setting that I used for cygwin, but syntax highlighting still isn't working – laserface Mar 27 '13 at 03:41
  • 5
    For me the file was in `C:\Program Files\Git\etc\vimrc` – mihkov Jun 15 '17 at 20:57
  • thanks @mihkov , I am using gitBash on windows-10 and vim on gitBash , vimrc is in `C:\Program Files\Git\etc` – christianbueno.1 Sep 05 '19 at 16:21
1

for my mingw64 windows 10 installation I found the default .vimrc at ...drum roll please... /etc/skel/.vimrc

user3281036
  • 115
  • 4