This is a bit of a weird question, I'll admit, but this is something that really annoys me. I have come to rely on the Emacs shortcuts (mainly ctrl ^+A, ctrl ^+E, ctrl ^+B, and ctrl ^+F) and the behavior of ctrl ^+P and ctrl ^+N is very different than in Emacs. With Emacs, going up a line will ignore soft wrapping and go to the next actual line, not the next displayed line. I've just gotten used to it, I guess. Is there any way to make the Cocoa/Emacs up and down keybindings behave like the real Emacs (preferably only ctrl ^+P and ctrl ^+N, not the arrow keys)?

  • As of Emacs 23.1: ** The C-n and C-p line-motion commands now move by screen lines, taking continued lines and variable-width characters into account. Setting `line-move-visual' to nil reverts this to the previous behavior (i.e., motion by logical lines based on buffer contents alone). – Alan Shutko Mar 26 '14 at 2:42
  • @AlanShutko Heh, I guess I haven't updated Emacs in a while, I'm usually using the command line version anyway. Maybe if I update I'll get used to it. – 0942v8653 Mar 26 '14 at 11:09
  • I'll admit, I set line-move-visual back to nil because I was used to the old way too! I just found it amusing. – Alan Shutko Mar 26 '14 at 15:13
  • @AlanShutko amusing? – 0942v8653 Mar 26 '14 at 16:53
  • Amusing that you want OS X to act like Emacs, when Emacs recently changed to act like OS X. – Alan Shutko Mar 26 '14 at 16:58

I don't know any way to do that in DefaultKeyBinding.dict.

For example selectLine: selects a wrapped or visual line and selectParagraph: selects a non-wrapped or hard line, but I couldn't find methods for moving a non-wrapped line up or down.

One thing you can do is to make command-delete and command-forward delete act on non-wrapped lines:

  "@\U007F" = deleteToBeginningOfParagraph:;
  "@\UF728" = deleteToEndOfParagraph:;

You can't remap command-left or command-right, so for example this doesn't work:

  "@\Uf700" = moveToBeginningOfParagraph:;
  "@\Uf701" = moveToEndOfParagraph:;
  • I wasn't expecting anything... oh well... – 0942v8653 Mar 26 '14 at 16:55

You must log in to answer this question.

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