By default, Vim on Windows uses the "Command Prompt" as its shell. If you have Cygwin installed (http://www.cygwin.com) you may want to use one of its shells instead, such as bash. This also makes all of the programs installed under Cygwin available for text processing.

The following settings may be included in a startup script to use bash as your shell. I have these commands in my gvimrc file in the installation directory.

set shell=C:/cygwin/bin/bash
set shellcmdflag=--login\ -c
set shellxquote=\"

I had problems with parts of the /etc/profile not being executed, but I didn't want to add -i (interactive) to the shellcmdflag because this caused the shell to always open in my home directory. I prefer that it opens in the directory containing the file being edited. However, without that part of /etc/profile running, the path wasn't set up properly. To get around this, I added the following line to /etc/profile:

Newer versions of the /etc/profile installed with Cygwin may behave differently.

Comments

vimdiff (in gvim) doesn't seem to work with cygwin as default shell

Go to cygwin setup, and install editors->vim,

It understands /cygdrive/c/ syntax, the regular Vim does not.

I use Cygwin along with the Windows version gVim. It's true that this version of gVim doesn't understand the "cygdrive" syntax, so you have to use the cygpath command to convert your paths before it will work.

Here is a bash script I wrote that translates the paths and launches gvim as a background process. I added an alias to my .bash_profile so I generally forget it's there. There are probably better ways to do this, but it works for me: