17

I have an iMac running OSX 10.8.4.

I've tried this on emacs built from Homebrew, as well as a version I've downloaded from http://emacsformacosx.com/

I've tried this with a completely clean ~/.emacs.d.

What happens when I go C-h k then type ctrl-up arrow, is I get a explanation that " runs the command backward-paragraph" and so on. The same thing with ctrl-down arrow.

When I try ctrl-right arrow, or ctr-left arrow, nothing happens.

If I go C-h b I see that they keys are bound:

<C-left> left-word <C-right> right-word

But nothing happens.

I'm running the standard, flat, mac keyboard with a cord.

3 Answers 3

22

Actually, I found that ctrl-left arrow and ctrl-right arrow did nothing, even for other applications on my Mac.

Under Keyboard -> Keyboard Shortcuts in System Settings, you'll have to deselect the Mission Control shortcuts, which appear to have been added through some OSX update.

enter image description here

3

⌃← and ⌃→ worked for me by default in Emacs.app and when I ran emacs from iTerm 2, but not when I ran emacs from Terminal.

If you use emacs in Terminal, try changing ⌃← from \033[5D to \033[1;5D and ⌃→ from \033[5C to \033[1;5C. You can insert \033 by pressing the escape key. \033[1;5D and \033[1;5C are the default values of the keys in iTerm 2.

If ⌃← and ⌃→ don't work in Emacs.app either, the problem might be that they are used for changing desktops, but you only have one desktop open, so they don't seem to do anything. Check System Preferences > Keyboard > Keyboard Shortcuts > Mission Control.

1

If you also need C-up and C-down in Terminal.app for Emacs, try adding the following keys under Terminal > Preferences > Profile > some profile > Keyboard:

^↑  \033[1;5A
^↓  \033[1;5B
1
  • Works beautifully! I'd like to know why these input combinations don't "just work" without having to specify arcane keymappings by hand… Jun 21, 2016 at 1:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .