If you want to set the editor only for Git, do either (you don't need both):
(如果要设置只对Git的编辑器,你要么(你不需要两者):)
If you want to set the editor for Git and also other programs , set the standardized VISUAL
and EDITOR
environment variables*:
(如果要为Git 和其他程序设置编辑器,请设置标准化的VISUAL
和EDITOR
环境变量*:)
export VISUAL=vim
export EDITOR="$VISUAL"
* Setting both is not necessarily needed, but some programs may not use the more-correct VISUAL
.
(*不必同时设置两者,但是某些程序可能未使用更正确的VISUAL
。)
See VISUAL
vs. EDITOR
. (参见VISUAL
vs. EDITOR
。)
For Sublime Text : Add this to the .gitconfig
.
(对于Sublime Text :将其添加到.gitconfig
。)
The --wait
is important (it allows to type text in sublime and will wait for save/close event.) (--wait
很重要(它允许在sublime中键入文本,并将等待保存/关闭事件。))
[core]
editor = 'subl' --wait
'subl' can be replaced by the full path of the executable but is usually available when correctly installed.
(可以用可执行文件的完整路径替换“ subl”,但通常在正确安装后才可用。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…