如何使Git使用我選擇的編輯器來提交?我更愿意用Vim編寫提交消息,但它正在Emacs中打開它們。如何將Git配置為始終使用Vim?請注意,我希望在全球范圍內(nèi)這樣做,而不僅僅是針對(duì)單個(gè)項(xiàng)目。
3 回答

慕尼黑8549860
TA貢獻(xiàn)1818條經(jīng)驗(yàn) 獲得超11個(gè)贊
集 在Git配置中: git config --global core.editor "vim"
設(shè)置 環(huán)境變量: export GIT_EDITOR=vim
VISUAL
EDITOR
export VISUAL=vim export EDITOR="$VISUAL"
VISUAL
VISUAL
EDITOR
.
為崇高的文本.gitconfig
--wait
[core] editor = 'subl' --wait
“subl”可以被可執(zhí)行文件的完整路徑替換,但通常在正確安裝時(shí)可用。

ITMISS
TA貢獻(xiàn)1871條經(jīng)驗(yàn) 獲得超8個(gè)贊
sudo update-alternatives --config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor). Selection Path Priority Status------------------------------------------------------------ 0 /bin/nano 40 auto mode 1 /bin/ed -100 manual mode 2 /bin/nano 40 manual mode* 3 /usr/bin/vim.basic 30 manual mode 4 /usr/bin/vim.tiny 10 manual mode Press enter to keep the current choice[*], or type selection number:
- 3 回答
- 0 關(guān)注
- 1345 瀏覽
添加回答
舉報(bào)
0/150
提交
取消