How do I specify a different editor for Mercurial on Windows?

早过忘川 提交于 2019-12-11 03:56:51

问题


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.


回答1:


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

In your .hgrc file.




回答2:


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)



来源:https://stackoverflow.com/questions/7004062/how-do-i-specify-a-different-editor-for-mercurial-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!