在windows上使用git的時候,在配置全局編輯器的時候遇到一點問題,現將解決辦法如下,
在.gitconfig中做如下配置:
[user]
name = coolcao
email = [email protected]
[core]
editor = "c:/Program Files (x86)/Vim/vim74/gvim.exe"
可是在使用的時候卻提示如下錯誤:
error: cannot spawn gvim: No such file or directory
error: unable to start editor 'gvim'
Please supply the message using either -m or -F option.
上網查得知,原來git config貌似移出了一層引號,因此加上便可,如下即可:
[user]
name = coolcao
email = [email protected]
[core]
editor = "\"c:/Program Files (x86)/Vim/vim74/gvim.exe\""
當然,如果你的終端配置了vim的環境變量,完全可以 editor=vim ,直接在終端裏面調用vim即可,只是Windows的終端字體太難看了,沒法更改(或者我不會,也不願改了),不如使用圖形化的gvim看起來舒服。