I'm trying to add to the emacs-like key bindings in OS X 10.7.5. In particular, in the default key bindings, alt-d and alt-b insert special characters, while I would like them to delete a word and move back a word. I've created a file ~\Library\KeyBindings\DefaultKeyBinding.dict
with the following content:
{ "~d" = "deleteWordForward:"; }
(as suggested in the answers to this question) and opened a new terminal window (I tried rebooting, too) but now the alt-d combination just beeps at me, and does nothing else. Any clues?
This should do the trick -- within the Terminal.app Keyboard settings, check the box Use option as meta key
. [I verified the solution works with OSX Snow Leopard 10.6.8.] Solution obtained from here: http://iancwill.com/blog/?p=116

来源:https://stackoverflow.com/questions/21937061/custom-emacs-like-key-bindings-on-os-x-defaultkeybinding-dict-not-working-as-ex