简体   繁体   English

Emacs键绑定“\\ C-'”

[英]Emacs keybinding for “\C-' ”

How do you set a function to \\C-' ? 你如何设置一个函数\\ C-'? when I try to do : 当我尝试做的时候:

(global-set-key "\C-'" 'myfunct) 

it gives me "Invalid modifier in string". 它给了我“字符串中的无效修饰符”。

What is \\C-' ? 什么是\\C-' Do you want something to happen when you type backslash+c+quote? 当你输入反斜杠+ c +引用时,你想要发生什么吗? Or do you mean C-' (control+quote)? 或者你的意思是C-' (控制+报价)? If it's the latter (and I guess it is), then you should use 如果它是后者(我猜它是),那么你应该使用

(global-set-key (kbd "C-'") 'myfunct)

For any key sequence you want to use, press Ch k and then press the key sequence you want to use. 对于要使用的任何键序列,按Ch k,然后按您要使用的键序列。 Then it tells you the name of the key. 然后它会告诉你密钥的名称。 That name is what should be used (with the code in the accepted answer). 该名称应该被使用(使用接受答案中的代码)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM