Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using GNU Emacs 23.1.1 on Ubuntu 10.04 and want to use something similar to the emacs clipboard settings described here, but I want to keep the default behavior and get the alternate one by pressing shift. I mean something like this

;;; these are the defaults anyway
(global-set-key "\C-w" 'kill-region)
(global-set-key "\M-w" 'yank-pop)
(global-set-key "\C-y" 'clipboard-yank)

;;; these should be the clipboard-aware versions
(global-set-key "\C-W" 'clipboard-kill-region)
(global-set-key "\S-\M-w" 'clipboard-kill-ring-save)
(global-set-key "\C-Y" 'clipboard-yank)

But only \S-\M-w works well, while using \C-W works exactly like C-w. I tried also \S-\C-w, but this ends up with "Invalid modifier in string".

How can I bind shiftcontroly separately from controly?

share|improve this question

1 Answer 1

up vote 1 down vote accepted
(global-set-key (kbd "C-S-w") 'clipboard-kill-region)
(global-set-key (kbd "M-W")   'clipboard-kill-ring-save)
(global-set-key (kbd "C-S-y") 'clipboard-yank)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.