3

Whenever HG needs to prompt for a commit message, or whatever, it opens up Notepad. This is annoying. I have Vim7.3 installed, and I've tried setting the EDITOR environment variable to point to gvim, to no avail.

I'm using PowerShell, but I've tried testing in both PowerShell and cmd. They both keep insisting on Notepad.

voithos
  • 68,482
  • 12
  • 101
  • 116

2 Answers2

5
[ui]
editor = C:\Path\To\gvim.exe

In your .hgrc file.

Pierre Bourdon
  • 10,521
  • 4
  • 33
  • 27
  • I don't know why I didn't try that first. Also, gvim was in the PATH, so I just put `editor = gvim` and it worked fine. – voithos Aug 10 '11 at 15:54
3

Mercurial tries to pick which program to call to edit a commit message by trying the following (in order):

  1. HGEDITOR environment variable
  2. editor configuration option in [ui] section (in hgrc or passed with --config ui.editor command-line option).
  3. VISUAL environment variable
  4. EDITOR environment variable
  5. vi, if none of the above is set

(source)

Idan K
  • 20,443
  • 10
  • 63
  • 83