Shelling out to cygwin bash from Windows vim Options

Andy AndyMHancock@gmail.com
Sun Sep 2 00:02:00 GMT 2012


This problem dogged me for many years, and I finally hunkered down to
chase it down.

Here is the solution that I found works for me:

"set shell=c:\cygwin\bin\bash.exe\ -i
   "Won't always find ~/.bashrc cuz depending on how vim is launched,
   "~ doesn't always resolve to c:/cygwin/home/$USERNAME
"let &shell='c:\cygwin\bin\bash.exe\ --rcfile c:\cygwin\home\' .
"  \ $USERNAME . '\.bashrc'
      "Backslashes are hated by bash.  Also needs -i to ensure bash is
      "interactive so that .bashrc is sourced
let &shell='c:\cygwin\bin\bash.exe --rcfile c:/cygwin/home/' .
   \ $USERNAME . '/.bashrc -i'
      " Depending on how vim is launched, c:/cygwin/home/$USERNAME
      " will sometimes be equivalent to ~.  If so, then it will be
      " replaced by ~ in &shell.

Thanks to all those who helped on the unix, bash, cygwin, and vim
forums. 


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list