Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Emacs differentiate between ctrl-r and ctrl-shift-r?

Tags:

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?

like image 752
Alex B Avatar asked May 13 '09 15:05

Alex B


People also ask

What does Ctrl Shift R do?

Chrome also offers the reload shortcut combinations of “Ctrl + F5” and “Ctrl + Shift + R” to reload the currently open page and override the locally cached version. F5 refreshes the page you are currently on.

How do you use Ctrl R?

Ctrl+R in Excel and other spreadsheet programs In Microsoft Excel and other spreadsheet programs, pressing Ctrl + R fills the row cell(s) to the right with the contents of the selected cell. To fill more than one cell, select the source cell and press Ctrl + Shift + Right arrow to select additional ones.


2 Answers

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.

like image 118
Trey Jackson Avatar answered Sep 24 '22 02:09

Trey Jackson


Yes -- one is "\C-r", the other is "\C-R". They can easily be bound to separate commands. For example, this should do the trick if placed in your .emacs file:

(global-set-key "\C-R" 'tags-apropos) 
like image 39
Adam Rosenfield Avatar answered Sep 25 '22 02:09

Adam Rosenfield