Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,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 gnufoo.org.

[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 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[21,744 views]  

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 whomever posted them. This site is not responsible for what they say.
Meta keys...
Authored by: lemko on Thu, Aug 2 2001 at 10:23PM PDT
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 Fri, Aug 10 2001 at 10:08AM PDT
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 Thu, Mar 16 2006 at 2:50PM PST
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 Sat, Dec 8 2001 at 7:59PM PST

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 Thu, Mar 16 2006 at 2:47PM PST
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 Sat, Dec 8 2001 at 10:10PM PST

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 Sun, Dec 9 2001 at 4:37PM PST
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 | # ]