在emacs23中如何绑定C-< return>到C-< return>而不是C-J [英] In emacs23 how to bound C-<return> to C-<return> instead of C-J

查看:168
本文介绍了在emacs23中如何绑定C-< return>到C-< return>而不是C-J的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用组织模式,每当我按Crtl +返回emacs而不是C-J。我知道这是因为当我使用c-h k然后按crtl +返回时,emacs显示:
它绑定到C-j。
有没有,我可以让它注册ctrl +返回,所以我可以插入标题?

I am trying to use org-mode and whenever I press Crtl+return emacs does C-J instead. I know this because when I use c-h k and then press crtl+return, emacs shows: "It is bound to C-j." Is there anyway I can make it register ctrl+return so I can insert headings?

我正在ubuntu 12.04 x64上通过终端使用emacs23。当我在Windows机器上这样做时,它会插入一个新标题。

I am using emacs23 through the terminal on ubuntu 12.04 x64. When I do this on my windows machine it does insert a new heading.

推荐答案

可能。正如@phils所说, C-Enter 通常不是绝大多数终端仿真器的有效序列。这是因为当您按下键或组合键时,终端会向相关应用程序发送一串字符。按 a 发送 a ,而 Enter 发送 CR 回车(也称为 ^ M \r \015 )。

Possibly. As @phils says, C-Enter is usually not a valid sequence for the vast majority of terminal emulators. This is because when you press a key, or key combination, the terminal sends a sequence of characters to the relevant application. Pressing a sends a, whereas Enter sends CR - carriage return (otherwise known as ^M, \r or \015).

在现代终端中实际实现的序列大多只是早期的物理终端,它们仿效的(特别是VT-100)。这些机器不允许与每个键(例如功能键)一起使用 Ctrl ,所以 C-F1 是不可能的,没有具有定义的转义序列。类似地,对于 C-Enter 没有控制顺序,所以当您按下它时,终端将忽略 Ctrl ,只看到 Enter

What sequences are actually implemented in modern terminals is mostly just a hang-over from the earlier, physical, terminals that they emulate (notably the VT-100). These machines didn't allow the use of Ctrl in conjunction with every key, such as the function keys, for example, so C-F1 was not possible and didn't have an escape sequence defined. Similarly, there is no control sequence for C-Enter, so when you press it, the terminal ignores the Ctrl and just sees the Enter.

然而,您可以在终端中定义自己的转义序列,然后您可以在emacs中绑定正确的组合键。 请参阅此处,例如我能够使用此方法来使用 C-Enter 。不幸的是,这仍然有点痛苦,因为它需要大量的配置,你可能仍然无法使用某些序列( C-M - %在konsole中不起作用)。和@phils一样,我已经使用了GUI,但我希望能够更好地与终端集成。

You may, however, be able to define your own escape sequences in your terminal, which you can then bind to the correct key combinations in emacs. See here, for example. I was able to use this method to be able to use C-Enter. Unfortunately, this is still a bit of a pain, as it requires a lot of configuration and you may still be unable to use some sequences (C-M-% doesn't work in konsole for me). As with @phils, I've taken to using the GUI, but I'd love to have better integration with my terminal.

这篇关于在emacs23中如何绑定C-< return>到C-< return>而不是C-J的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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