From: Jacob Helwig Date: Sat, 06 Mar 2010 07:22:34 GMT Subject: Re: using gvim as editor on Windows Message-ID: <8c9a061003052322v446acddbm5792038af450d0b9@mail.gmail.com> In-Reply-To: <20100306070628.GM2480@ece.pdx.edu> On Fri, Mar 5, 2010 at 23:06, Tait wrote: > > I'd prefer to use gvim as an editor on Windows XP instead of vim. (I also > prefer it as a difftool, but that's a separate issue.) Gvim releases > the terminal when it launches, which git doesn't like too much. So I > create gvimf.cmd in my path and use it for core.editor. Gvimf.cmd is > quite simple; it calls: >        start "dummy" /b /wait "C:\Program Files\Vim\vim72\gvim.exe" %* > > In .gitconfig: > [core] >        editor = gvimf.cmd > > This works well enough for git commit. However, git rebase -i is not > happy. It errors: >        C:\path to\repo> git rebase -i HEAD~10 >        The system cannot find the file dummy. >        Could not execute editor > > Okay, I can fix that. I change core.editor to "cmd \\/c gvimf.cmd". (This > is the same pattern I use for gvim as a difftool.) Now my .gitconfig has: > [core] >        editor = cmd \\\\/c gvimf.cmd > > Git rebase is happy, but git commit is not. It errors: >        C:\path to\repo> git commit >        'OMMIT_EDITMSG' is not recognized as an internal or external command, >        operable program or batch file. >        error: There was a problem with the editor 'cmd \\/c gvimf.cmd'. >        Please supply the message using either -m or -F option. > > In the selfish hope to avoid work, has anyone else already encountered > and solved how to use gvim as an editor? > > Tait > Use the -f (stay in the foreground) flag. I haven't tried this in Windows, but that's how I've used it in Linux. [core] editor = gvim -f