Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Enabling meta-key Emacs shortcuts in Cocoa apps System
Notice how Cocoa apps actually have emacs bindings? At least on the control-key anyway (try control-A in a text field in OmniWeb). How would you like to have those meta (option) key bindings available as well? It's simple enough to do. Just copy this file to your ~/Library/KeyBindings directory (make one if you don't have it).

For more info check out this page on

[Editor's note: You may wish to visit the page first to make sure of what you're downloading. And if you don't use Emacs and/or like their keyboard-editing shortcuts, then you probably won't be interested in this hack all that much!]

[Submitted by semios on Thu Jul 26.]
  • Currently 2.50 / 5
  You rated: 2 / 5 (4 votes cast)

Enabling meta-key Emacs shortcuts in Cocoa apps | 7 comments | Create New Account
Click here to return to the 'Enabling meta-key Emacs shortcuts in Cocoa apps' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Meta keys...
Authored by: lemko on Aug 02, '01 10:23:44PM

Seems almost everyone here uses Option as their Meta key, but I can't. Why?
Otherwise, that looks like a nice hack, I just wish I didn't have to use Esc...

[ Reply to This | # ]
Meta keys...
Authored by: TTop on Aug 10, '01 10:08:35AM

I'd also like to know how to make the option key my meta key -- I'm an emacs geek, but I completely lose my efficency if I have to use ESC.

[ Reply to This | # ]
Meta keys...
Authored by: jacobolus on Mar 16, '06 02:50:24PM

I'm not sure if this was the case in 2001 when the parent comment was written, but now it's possible to tick a checkbox in the "emulation" tab of the Terminal window settings to get option to work as meta key.

[ Reply to This | # ]
Meta keys...
Authored by: misaka on Dec 08, '01 07:59:13PM

I'm not certain how to fix this, but Apple has some information that may be relevant at their page Text System Defaults and Key Bindings. The biggest question is where exactly would you put the 'NSMnemonicsWorkInText' command mentioned there ...

[ Reply to This | # ]
Meta keys...
Authored by: jacobolus on Mar 16, '06 02:47:55PM
NSMnemonicsWorkInText is not supported by OS X. The other text defaults can be edited, by running the defaults command in the terminal, for instance:

defaults write -g NSRepeatCountBinding "^u"

[ Reply to This | # ]
More key bindings.
Authored by: misaka on Dec 08, '01 10:10:24PM

Check out documentation on NSResponder for more commands which can be bound to keys.

[ Reply to This | # ]
Completion for filenames, and more!
Authored by: misaka on Dec 09, '01 04:37:49PM
While looking around at the various key binding commands available I found the 'complete:' command. It appears that Cocoa Applications and classes provide customized auto-completion through this methods. As a result, completion for filenames in the 'Open' dialog or for function/variable names in Project Builder are possible! Just bind the 'complete:' command in your DefaultKeyBindings.html to a sensible key binding (I use Option-/ for example), et voila.

For more information on how to customize keybindings check out my page on the subject.

[ Reply to This | # ]