Emacs Shell:保存提交消息 [英] Emacs shell: save commit message

查看:60
本文介绍了Emacs Shell:保存提交消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前我已经开始使用emacs,在emacs外壳(M-x外壳)中使用git时遇到了问题.当我'git commit'或'git commit --amend'时,它会打开vim来编辑和保存提交消息.我可以,但是我找不到保存和退出vim的方法,因为按ESC不会触发vim正常模式,而ESC是我的emacs metakey. 我尝试将git编辑器更改为emacs,但是它也不起作用,似乎emacs外壳无法运行emacs,并且它也没有打开我认为可以的新缓冲区.

I've started using emacs a few days ago, and I'm facing a problem when using git in the emacs shell (M-x shell). When I 'git commit' or 'git commit --amend', it opens vim to edit and save the commit message. I'm ok with that, but I can't find a way to save and exit vim, since hitting ESC does not trigger vim Normal Mode, and ESC is my emacs metakey. I tryed changing my git editor to emacs, but it doesn't work either, it seems like emacs shell cannot run emacs, and it doesn't open a new buffer like I thought it would.

emacs: Terminal type "dumb" is not powerful enough to run Emacs.

有没有一种方法可以在emacs shell中使用git命令行(我宁愿不必使用像magit之类的git前端客户端,...)?

Is there a way I can use git command-line (I'd rather not have to use a git front-end client like magit, ...) with the emacs shell ?

谢谢, 罗宾

推荐答案

@romainl在答案中发布了答案,因为它可以满足我的要求: <C-o>退出插入模式,:wq:x并按Enter.

Posting the answer from @romainl in comment since it does what I want: <C-o> to get out of insert mode, :wq or :x and Enter.

这篇关于Emacs Shell:保存提交消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆