Macs Have Emacs Key Bindings?
Tagged as: May 18As a relatively new user of Macs, I was amazed to find that I could use some Emacs key bindings by default in Mac OS X. I’m sure that many people out there already know about this, but I thought it significant enough to write about it. Key bindings are basically combinations of keys that will perform some action because it is associated with it. For example, Ctrl+S is generally regarded as being used to save something, Ctrl+P is used to print, etc.
Anyways, for those of you using Mac OS X and who don’t know much about Emacs I wanted to give a short run down. Emacs is basically an extensible text editor with the ability to have user-defined functions. There are key bindings that have a specified meaning when you’re using Emacs. Some useful ones that you might consider trying out are:
Ctrl+f - Move 1 character forward
Ctrl+b - Move 1 character backward
Ctrl+d - Delete character in front of the curser
Ctrl+a - Move to beginning of line
Ctrl+e - Move to end of line
There are many more key bindings available to Emacs that seem like they will usually get overridden by the program. Remember, this hint is for Mac OS X users. The most useful place that I could use these key bindings was in text fields in Firefox.
Try it out and let me know. Don’t blame me, though, if you hit the wrong button or if the key binding is overridden to be something else in the program that you try it with!
well, if you’re using a mac, key bindings are usually done using the command key (a.k.a. the “four-leafed-squigley” key) rather than the ctrl key. Switching between computers at work and home make me annoyingly aware of this.
@william
You’re right, the Command key is used for many of the key bindings that are done with the Control key in Windows. I map all of the computers that I use to have the Caps Lock key set as another Control key (just like the old Sun keyboards) instead of stupid Caps Lock which I find no use for. You’re right that it is annoying to have to switch to using my thumb to do access the Command key though. I don’t think that’s too ergonomic. Try out these Emacs key bindings sometime and see how if they work for you and whether you like them.
@derek
i did not know that about being able to map the caps lock key. very very clever.
and i just started trying out the emacs key bindings, now that i’m on my mac at home. my initial reaction was “ooooh! magic!” a few of these controls are actually pretty useful for my powerbook’s keyboard. it doesn’t have set keys for end/beginning of lines, nor does it have the delete-forward key. this could prove to be quite handy! thanks, derek!
wow, NERDS.
@william
I’m glad that you like it. If you think about it, it makes sense that you can make any key on your keyboard mean something else to your computer. Just because there’s a symbol or words pasted onto a key does not give a key its meaning.
@tiff
I would say that this conversation is more of the “geek” variety than the “nerd” variety. Perhaps I should write about what I think the differences are.
@derek
yeah, i once popped off all the keys from my keyboard so that i could clean them. i later read somewhere that i could’ve changed the keyboard layout to dvorak if i had so desired. but then i realized that i didn’t want to go through the trouble of re-learning how to type. interesting idea, though.
@tiff
i think i agree with derek here. it’s “geek.” also, if you wanted to address derek directly, you could probably just use the term “haxorz.”
also, is it just me, or are line breaks in commenting not handled automagically?
do i have to manually enter the html for line breaks?
@william
You are very correct. I noticed it earlier, too. However I thought that perhaps it was just the particular comment that I was looking at. Now I realize that it was a result of one of the plugins that I was using. Basically the more-smilies plugin was somehow getting rid of the Carriage Returns that were saved in the database (I looked and saw them there).
Support Bug describing problem
Carriage Returns and the like
I’ve disabled the plugin and line breaks are working as expected.