Hacker News new | past | comments | ask | show | jobs | submit login
Tips for the aspiring Emacs playboy (lispcast.com)
54 points by kirubakaran on Aug 8, 2009 | hide | past | favorite | 25 comments



I'm going to have to disagree with '6. Keep Your Keybindings Standard.'

When I started with emacs, there were some bindings that would make my hands ache after a day of use, usually from the transition between difficult keybindings, not any one key combination in isolation. One of the first things I did was add in the ergoemacs bindings, and I never regretted it. It's not as if doing so made me suddenly forget what the old bindings were, although I am slower during the rare cases when I'm on the normal keybindings. But it's a small price to pay for not having my fingers hate me.

Editors are meant to be customized to your workflow and what works best for you.


I agree with you about the default keybindings (they're sadistic), but I think that people will have an easier time learning Emacs if they wait to start rebinding things until they're familiar with the conventions.* There are a lot of patterns in the way keybindings are defined for various major modes, for example, and rebinding everything to make it more like textmate or whatever obscures them. Also, it's a good idea to check if new bindings are replacing another highly useful command, particularly if one doesn't know how to access it otherwise.

Some of this probably matters less if using Emacs on other peoples' computers isn't an issue, though. (Same with using Dvorak or other layouts.)

* Perhaps around the time they start learning Elisp, rather than copying and modifying other peoples' config files. Nothing wrong with doing that, just, that comes much earlier.


Yeah, I was going to post this as well. If you use Emacs change your keybindings to whatever you're comfortable with. This isn't freakin' VI or an editor you use in a sysadmin / dead server environment: Emacs should be the editor you spend most of your life in as an IDE, for mail, news, writing documents, etc.

Also put your keybindings.el somewhere online so you can load it up when you're in a new environment.

If you use Bash some of the handy default Emacs bindings will be known to you already.


That mostly depends on how much you use ONLY your own system. If you have to use different systems much, getting used to idiosyncratic keybindings will REALLY slow you down, and the faster and more instinctively you use them the more it will slow you down.

I do take some exception to his advocating the arrow keys - they slow you down less than the mouse, but ^P, ^N, ^F, and ^B do the exact same thing as the arrow keys and you don't have to take your hand off the keyboard at all.


Yes and no. When I first started off with Emacs, I used the CUA bindings (Windows-esque bindings for C-x/C-v/C-c). That was great to begin with, but inevitably a change of settings as big as CUA never quite sat right with the rest of Emacs, and prevented me from really moving on. After a while I declared cua-mode to be a crutch that was holding me back, disabled it, and I'm extremely glad I did.

More recently I've moved mostly away from the arrow-keys navigation (not just up/down/left/right instead of n/p/b/f but Home End instead of C-a, C-e; C-left, C-right instead of M-b, M-f; C-up, C-down instead of M-{, M-}; C-Home, C-End instead of M-< and M->, etc.) to the more central commands. This is less of a win but has nonetheless sped up my editing still further.


"Editors are meant to be customized to your workflow and what works best for you."

Sure, but if you do it too soon, all tutorials and howtos will be a pain to follow.

Comfort is important. How are you using your F1-F12 keys?

Also, if you have a whole bunch of bindings you may want to use a 24-function-key keyboard for IBM's (like http://www.quadibloc.com/comp/images/122hc.gif or http://www.nlynx.co.uk/products/keyboard.aspx) or a Sun Type-7 Unix lay-out (the one with special keys for your left pinky) may help.


I bought a Kinesis keyboard, and that solved most of my RSI issues with emacs. Thanks for the tip on ergoemacs; I still have some issues when using my laptop.


I agree with this - I customize all my keybindings if they are two arcane or uncomfortable. Combining this with a fanatical preference to always use my own computers (why wouldn't I? - I spent so much time customizing it!) makes me efficient and productive.


This is a great article for users of ANY editor. I'm a vim user and got a lot out of it.

Even more, many of these tips are abstract enough to be applicable to users of almost any complicated software tool, particularly ones used for hours a day.


You're right. The article is good, and reminds me of some very good tips given by the creator of VIM (Bram Moolenaar) in a Google Tech Talk:

http://video.google.com/videoplay?docid=2538831956647446078


Don't forget the http://www.emacswiki.org/ A bit messy site, but the single greatest resource for emacs user.


Ok, I'm not a PC-nazi but I think someone needs to call the article out:

This is generic claptrap ("use help"?! he, and it's pretty clear it's a he, could have at least looked at how hard emacs help is to use for beginners) interspersed with sexist pictures and commentary. It is offputting to many people, and I'd like to see my favorite editor associated with higher caliber tutorials.


Each of the tips is an important and non-obvious point, and several are unusual and probably good advice: post a cheat sheet, write down interesting commands, update your cheat sheet. Tips for beginners are always pretty generic. I'm sure someone, somewhere has suggested the same thing, but I give him credit for 33% unpredictable content, which is actually pretty good.

As a longtime emacs user, I'm still working on a few of these. I often discover useful new commands and forget them by the time I need them again -- obviously I should have them posted on my cheat sheet. I don't use command-apropos or the included documentation as much or as well as I should, either. I think insufficient use of help is way too common -- a lot of people ask me for help as soon as Google fails them.


I do not understand how these pictures are sexist.


Only men should be using computers, duh.


I've tried to get into emacs and vi but neither of them "feel right". Generally it seems like these editors take a particularly geeky sort of personality to get into in the first place, which is awesome. The nature of emacs isn't exactly user-friendly, so someone moving towards it would already be adventurous enough to parse the help files (and has probably read a fair share of man pages as well... blegh).

As for the images and title of the article: what could have been (very often times these sorts of pieces ARE) a very drone-like, dry sack of shit for a paper that only someone with a robotic policeman's mentality could enjoy, I found to be humorous and filled with life.

Will I be using emacs anytime soon? Probably not but it's encouraging to see that there are cool, funny, HUMAN community members out there who want to help get people excited and productive with something they enjoy.


Thanks for posting this. The other content on the site is pretty good too!


I can't agree with the `2. Don't use the mouse'. Unless Emacs' mouse support is completely broken (doubtful), mouse is only going to increase productiveness.

http://plan9.bell-labs.com/wiki/plan9/Mouse_vs._keyboard/ind...


I have an immediate, almost visceral disagreement with the suggestion that a mouse is more efficient, but I may be wrong. For sake of argument: I think the "just pointing vs. using the keyboard and getting more thought involved about structure disrupts the sense of time" argument may have something to it. Still, using a keyboard well counterbalances this by being able to take advantage of greater structure - I very frequently use elaborate keyboard macros, for example, and the mouse doesn't have any clear way to say, "Ok, the thing I just did, apply that in a batch to the rest of those that look like a C function prototype." The mouse is more immediate, but you can do more powerful manipulation with the keyboard if you know the program's keyboard shortcuts, etc. (That's not necessarily a good trade-off for many kinds of programs, but for a text editor / IDE, it's probably worthwhile.)

While there have been some attempts to do that with mice (such as mouse gestures), by design, mice are about position, changes of position, with a few buttons as flags. There aren't enough distinctive signals.

Also: The Emacs mouse support is not great. It probably hasn't been a high priority.


"Also: The Emacs mouse support is not great. It probably hasn't been a high priority."

In what way? It's certainly as good as it is in any other editor, with the addition of several very Emacs-esque mouse-driven commands. For example, right click marks the region from point to the click point and saves it in the kill rin (like M-w); double right click kills that region. Using M- does the same, but modifies the secondary selection. Using C- with the mouse pops up several useful context menus. Try playing around with C-h k <mouse button> in various contexts.


I can understand what you're saying, and I agree, but I think you miss the idea of abandoning the mouse. You're not doing it with intent to lose the marginal benefit of the mouse, rather, you need to give it up in order to become more efficient and familiar with the keybindings.

Thus, once you are no longer a beginner (the guide's target audience) you may graduate to keyboard+mouse. I don't use emacs or vi(m) or anything truly in line with them (textmate is my closest) but I have no doubt that someone who uses only the keyboard for three months and then reintroduces the mouse will show a greater capability with the tools than the same person spending the same time using both keyboard and mouse.


Depends on what you are doing. If you want to kill a sexp, the keyboard is going to be faster. If you want to kill a random block of text that has no structure, then sure, the mouse is going to be faster.

Guess which programmers usually do.


If you're programming Perl, then it's going to be "kill a random block of text that has no structure."

Sorry, couldn't resist. :)


Most language modes in emacs redefine the concept of "sexp", "sentence", "word", etc. so that "kill-sexp" and "kill-sentence" and "kill-word" work as you'd expect. cperl-mode is no exception. (If it is, submit a bug report at http://github.com/jrockway/cperl-mode !)


You've gotta put the blast shield down before you can begin to sense the Force.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: