Emacs可以区分ctrl-r和ctrl-shift-r吗? [英] Can Emacs differentiate between ctrl-r and ctrl-shift-r?

查看:166
本文介绍了Emacs可以区分ctrl-r和ctrl-shift-r吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 Ctrl + R 绑定到'isearch-backward 并绑定 Ctrl + Shift + R 'tags-apropos 但是我无法区分两个键



可以emacs区分 Ctrl + R Ctrl + Shift + R ?什么应该进入我的.emacs文件以允许这个键盘绑定?

解决方案

是的。



pre> (global-set-key(kbdCr)'isearch-backward)
(global-set-key(kbdCSr)' apropos)

找出这种问题的答案的方法是在键上做一个帮助 Ch k ,并键入您感兴趣的按键。Emacs在帮助缓冲区中显示的是您可以传递给宏的字符串 kbd


I'd like to bind Ctrl + R to 'isearch-backward and bind Ctrl + Shift + R to 'tags-apropos but I can't distinguish between the two key presses.

Can emacs differentiate between Ctrl + R and Ctrl + Shift + R? What should go into my .emacs file to allow this keybinding?

解决方案

Yes.

(global-set-key (kbd "C-r") 'isearch-backward)
(global-set-key (kbd "C-S-r") 'tags-apropos)

The way to figure out the answer to this kind of question is to do help on a key C-h k, and type the keystrokes you're interested in. What Emacs shows in the Help buffer is the string you can pass to the macro 'kbd.

这篇关于Emacs可以区分ctrl-r和ctrl-shift-r吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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