Tuesday, January 21, 2014

emacs windmove and Mavericks Terminal.app

I had trouble getting emacs' windmove mode working right under Mavericks' terminal app. It seems that the terminal app does not have a keyboard mapping for S-up and S-down. For posterity's sake, here is what I did.

First, I had to add these to terminal's keyboard map:

shift cursor up: \033[1;2A
shift cursor down: \033[1;2B

Then, in my init.el, I had to add:

(define-key input-decode-map "\e[1;2A" [S-up])
(windmove-default-keybindings)

I'm sure there's got to be an easier way to do this, but this got me running.

5 comments:

Aluink said...
This comment has been removed by the author.
Aluink said...

Dude? Emacs? Idk if we can be friend anymore.

Daniel Santa Cruz said...

LOL! I've been using emacs for at least 5 years now :-)

Christos Chryssochoidis said...

Works like a charm. Thanks!

Christos Chryssochoidis said...
This comment has been removed by the author.