在 Emacs 中重新绑定 C 空间
我尝试了各种版本均无效:
(global-set-key (kbd "C-<space>") 'tempo-complete-tag)
(global-set-key [C-space] 'tempo-complete-tag)
我正在使用 CUA 模式并在 Ubuntu 上运行 Emacs,版本:GNU Emacs 23.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.18.0) 2009-09-27 on crested,由 Debian 修改
当我手动运行 tempo-complete-tag
时,它告诉我它已绑定到 C-space,但 C-space 仍然运行 cua-set -mark
(或者如果禁用 CUA,则set-mark-command
)。
如何将 Emacs 中的 C 空间快捷方式重新绑定到我决定的命令?
I've tried various version to no avail:
(global-set-key (kbd "C-<space>") 'tempo-complete-tag)
(global-set-key [C-space] 'tempo-complete-tag)
I'm using CUA mode and running Emacs on Ubuntu, version: GNU Emacs 23.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.18.0)
of 2009-09-27 on crested, modified by Debian
When I run tempo-complete-tag
manually it tells me it is bound to C-space but C-space still runs cua-set-mark
(or if CUA is disable, set-mark-command
).
How can I rebind the C-space shortcut in Emacs to a command I decide?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Ch k (key)
将告诉您 Emacs 如何引用给定的键(在本例中为“C-SPC”)。(global-set-key (kbd "C-SPC") 'tempo-complete-tag)
将执行您想要的操作。我总是使用
(kbd)
函数进行键绑定,因为它允许您以通常在其他地方编写的方式引用该键。请记住,C-SPC 是标准的
set-mark-command
绑定!就我个人而言,我会选择不同的东西:)C-h k (key)
will tell you how Emacs refers to a given key (which is "C-SPC" in this instance).(global-set-key (kbd "C-SPC") 'tempo-complete-tag)
will do what you want.I always use the
(kbd)
function for key-bindings, as it allows you to refer to the key the same way it is typically written everywhere else.Do keep in mind that C-SPC is a standard
set-mark-command
binding! Personally I'd pick something different :)另请记住,如果您的模式不覆盖它,“global-set-key”只会执行您想要的操作。我懒得加载节奏来查看它是否确实覆盖了
C-SPC
,但它很可能会这样做,在这种情况下,您想将其放入您的 .emacs 中:Also keep in mind that "global-set-key" will only do what you want, if your mode doesn't override it. I'm too lazy to load tempo to see if it does indeed override
C-SPC
, but it might well do so, in which case, you want to put this in your .emacs:键绑定的替代语法是通过向量:
Alternative syntax for key binding is via vector: