开发者

Forcing myself to master Emacs

Assuming a superficial knowledge exists, how might one go ab开发者_运维技巧out forcing a mastery of Emacs?

Assume also that said person currently uses Aquamacs but falls back on Mac OS X-isms far too often. This person is serious (this time for sure), and needs some advice.


C-h t

Take the tutorial, and actually follow it all the way through.

Then, learn some of the more useful time-saving functionality, like C-x ( to start recording a macro, C-x ) to finish, and C-x e to execute the last macro. Read the manual (C-h i m emacs RET) for more details. Try learning to browse through the documentation within info mode in Emacs, rather than resorting to the web, to get more used to how navigation works in Emacs.

Oh, and try using an Emacs that doesn't have the Aquamacs key bindings. There is a command line version of Emacs included on Mac OS X, though using the Meta key is a pain there (you have to either set your Terminal preferences to use Option as meta, or always use Esc). You can also use MacPorts to install an X11 version of Emacs, which won't have the Mac style keybindings.

Also, try using Emacs keybindings in other Cocoa text editing views. It's not something that a lot of people know, but a few common Emacs keybindings also work in the standard Cocoa text controls, such as C-a to go to the beginning of a line, C-e to go to the end, C-k to kill to the end of the line, C-y to yank from the kill buffer (which is different than the pasteboard). C-t transposes two characters, and I'm sure there are more that I can't think of at the moment. Using these on a regular basis will get your fingers used to Emacs keybindings (many of these also generally work in most shells, and in programs that use GNU Readline for being able to accept editable input).

For any technology you use on a regular basis, seek out the best Emacs mode you can for that technology, and learn it inside and out. For instance, if you're a Git user, I find Magit indispensable. If you program JavaScript, make sure you use Steve Yegge's js2-mode. If you use Common Lisp, learn SLIME, if you use Erlang learn distel. Sometimes, the best Emacs mode won't be the best tool you can find for a job, but for many, many things it's pretty good, and great to have it all integrated in to the same editor and environment.

Keep practicing everything you learn, over and over. I find that I frequently learn a new Emacs keybinding, and then promptly forget it because I don't use it for another 6 months. You can alleviate this problem by looking for any excuse you can to use a new keybinding after you first learn it, to help get it ingrained in your memory.


  • Don't use Mail.app, Gmail, or whatever -- use Gnus.
  • Don't use a web browser for programming information, use Info pages where possible.
  • Don't use Terminal, use M-x shell.
  • Make sure you have a right and a left control key. I have a MacBook and have mapped the right option key to control.
  • Swap left control and capslock.
  • Read Steve Yegge's advice.
  • Find a killer app.
  • Always, always, always read the Emacs manual and use M-x apropos when you want to do something but don't quite know how. Emacs probably has the best online help of any program, ever.


I found the only way to master anything is to do it daily (practice, practice, practice).

As far as Mac OS X-isms... I'm not sure that's a problem per-say. Personally, in my quest to master Vim, I ditched Mac OS X entirely and have been happily living in GNU/Linux-land since.

Good luck!


Practice.

Try to answer questions here that are tagged Emacs.

Practice more.

Visit the Emacs Wiki and try ideas from it.

Practice even more.

Good luck!


Step 1: Notice you are doing something complicated.

Step 2: Read the manual to see if there's an easier way.

Step 3: Undo your changes.

Step 4: Do things the "new way".

Step 5: You've just learned one more new feature. Go to Step 1.


Switch to Carbon Emacs which doesn't have all the Mac bindings. It's a lot closer to the Unix Emacs experience but doesn't require X11 installed. The only real downside to Carbon Emacs is that Apple has no 64 bit Carbon and is probably phasing Carbon out, so Carbon Emacs might not have a long life ahead of it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜