Emacs 作为 git 编辑器,什么是 Rebase 模式?

Eri*_*rik 7 git emacs

当我运行 git rebase -i 时,我在 emacs 中得到了绝对可怕的 Rebase 模式。

这仅接受一些预定义的命令,如

c -> 选择

r -> 改写

等等...

即使我更改为文本模式,emacs 也会自动神奇地使 git-rebase-todo 文件只读。我怎样才能禁用它?

我发现的唯一解决方案是使用 vim 作为编辑器(我不想要的东西,我一般喜欢 emacs)

小智 2

自动rebase-mode激活由变量触发auto-mode-alist 。您可以尝试禁用它以基本模式编辑git-rebase-todo文件(没有特殊快捷方式,没有自动只读标志,...):

(setq auto-mode-alist (delete '("git-rebase-todo" . rebase-mode)
                              auto-mode-alist))
Run Code Online (Sandbox Code Playgroud)

另一方面,您可能希望magit 直接从 emacs 中实现 git 操作。