3

I tried the following to assign Ctrl-left/right for moving one word forward/backward, but none of them works:

(global-set-key (kbd "<C-left>") 'backward-word)
(global-set-key (kbd "<C-right>") 'forward-word)
(global-set-key (kbd "C-<left>") 'backward-word)
(global-set-key (kbd "C-<right>") 'forward-word)

Has anyone an idea?

  • What does ` C-h k` follow by hitting control and the right arrow report? That will show the key to use in kbd. – Tassilo Horn Apr 18 '15 at 7:01
  • BTW, keyboard macros are something else. Your question concerns key bindings. – Tassilo Horn Apr 18 '15 at 7:03
  • C-h k followed by C+<left> or C+<right> does not do anything (emacs does not take the key combination as input at all). – user2683038 Apr 18 '15 at 9:51
  • Then some other app or the OS "steal" it. Sorry, I don't have a Mac so have no clue how to change that. – Tassilo Horn Apr 18 '15 at 10:32
5

Ctrl-left/right is assigned to Mission Control by default. Remove the assignment of those two shortcuts in Mac OS X system preferences / keyboard / keyboard shortcuts: Chose Mission Control on the left side and uncheck assignments on the right side.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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