
每当我使用 git 提交或重新设置时,我都会进入 vim 来编辑我的消息,我更喜欢使用 Kate,https://kate-editor.org
答案1
首先您需要安装 Kate。
sudo apt install kate
然后您需要设置 GIT_EDITOR 环境变量。可能在您的~/.profile
或等效的环境中。
export GIT_EDITOR="kate --startanon --block"
--block
或-b
,直到最近的 Ubuntu 升级(23.10)才需要。但它是阻止终端并且不在后台启动所必需的。否则,git 将终止并忽略您在编辑器中所做的更改。