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

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

问题描述

我正在尝试使用 org-mode,每当我按下 Crtl+return emacs 时,都会使用 C-J.我知道这是因为当我使用 c-h k 然后按 crtl+return 时,emacs 显示:它绑定到 C-j."无论如何我可以让它注册 ctrl+return 以便我可以插入标题吗?

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 15).

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, or 15).

在现代终端中实际实现的序列大多只是它们模拟的早期物理终端(特别是 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-<返回>而不是 C-J的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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