在Emacs中重新绑定C空间 [英] Rebind C-space in Emacs
问题描述
我已经尝试过各种版本无效:
(global-set-key(kbdC-&空间>)'tempo-complete-tag)
pre>
(全局设置键[C-space]'节奏完整标签)
我正在使用CUA模式并在Ubuntu上运行Emacs,版本为:GNU Emacs 23.1.50.1(x86_64-pc-linux-gnu,GTK + Version 2.18.0)
of 2009-09-27 on crested,由Debian修改
当我运行
tempo-complete-tag
手动告诉我它绑定到C空间,但C空间仍然运行cua-set-mark
(或者如果CUA禁用,
如何将Emacs中的C-space快捷方式重新绑定到我决定的命令?
解决方案
Ch k(key)
会告诉你Emacs如何引用给定的键(在这种情况下是C-SPC)。(global-set-key(kbdC-SPC)'tempo-complete-tag)
将会做你想要的。
我总是使用
(kbd)
函数来进行键绑定,因为它允许你按照通常在其他地方编写的方式来引用该键。请记住,C-SPC是标准的set-mark-command
绑定!个人我会选择不同的东西:)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 runscua-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?
解决方案
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 :)这篇关于在Emacs中重新绑定C空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!