git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: using gvim as editor on Windows

From
Jacob Helwig <jacob.helwig@gmail.com>
Date
Mar 6, 2010, 07:22 UTC
Message-ID
<8c9a061003052322v446acddbm5792038af450d0b9@mail.gmail.com>
In-Reply-To
<20100306070628.GM2480@ece.pdx.edu>
On Fri, Mar 5, 2010 at 23:06, Tait <git.git@t41t.com> wrote:
Show 35 quoted lines
>
> 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
Previous: TaitNext: Tait
Message 2 of 10 in “using gvim as editor on Windows”
  1. TaitMar 6, 2010
  2. Jacob HelwigMar 6, 2010
  3. TaitMar 6, 2010
  4. Markus HeidelbergMar 6, 2010
  5. TaitMar 8, 2010
  6. Markus HeidelbergMar 8, 2010
  7. TaitMar 9, 2010
  8. Junio C HamanoMar 9, 2010
  9. TaitMar 11, 2010
  10. Johannes SixtMar 11, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.