0

I'm running emacs from an iTerm2 command line. I currently have the following two lines in .emacs:

(keymap-global-set   "ESC <up>"      'scroll-down-command)
(keymap-global-set   "ESC <down>"    'scroll-up-command)

On my Mac, this is done with Option+ArrowKey. I'd like to add key bindings to scroll-other-window- variants of the above, using for instance Option+Shift+ArrowKey or Option+Control+ArrowKey. I haven't found a way of doing this. Is there any way to modify a Mac arrow key with something besides Option?

;; (keymap-global-set   "ESC <up>"      'scroll-other-window-down)
;; (keymap-global-set   "ESC <down>"    'scroll-other-window-up)
1
  • 2
    This question is similar to: Shift+Up isn't recognized by Emacs in a terminal. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.
    – db48x
    Commented Nov 9 at 1:41

1 Answer 1

0

You’re using Emacs inside of a terminal, so it is subject to the limitations of the terminal. Seek out all the past answers where I and others have explained these limitations in great detail, and the possible ways around them. Short answer: you can’t.

1
  • Specifically in the case of iterm2, you can do this, by going to Settings/profiles, selecting a profile, then in "Keys/General", ensure that "Treat ⌥ as Alt" is enabled, as well as "Left Option key: Esc+"
    – rpluim
    Commented Dec 9 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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