We use vi, son; they use emacs
Thursday, 5 July 2007 16:58(The title of this entry is from an old cartoon that appears here, among other places -- does anyone know the original source?)
The group here has settled on using emacs as their preferred editor and developers have customised it, as the saying goes, to within an inch of their lives.
While there is, apparently, a good deal of rivalry between vi users and emacs users, I use vim mostly because they taught me vi when I learned Unix, so it's what I know. I have no enmity against emacs, but I just never learned it so far and saw little need to.
However, I've decided to give emacs a go, mostly because of said customisation. That way, if someone says that something is done by pressing F4, I can duplicate that without having to figure out what I'd have to do by hand.
Fortunately, the arrow keys and PgUp/PgDown work; I think I'd go bananas if I had to use Ctrl+P etc. to move around.
I have a feeling I'll only scratch the surface, partly because there are so many features that reading the docs looking for interesting or immediately useful ones is probably not easily possible.
However, if any of you are emacs users, are there commands or options or something you'd like to recommend I consider learning? As in, if I only memorise twenty (or other small-ish number) commands, which ones would be the most useful, in your opinions? For the purposes of this exercise, imagine I know basically nothing.
no subject
Date: Friday, 6 July 2007 00:58 (UTC)no subject
Date: Friday, 6 July 2007 01:25 (UTC)I assume you know the standard unix things like C-a & C-e for beginning and end of line, as well as C-k & C-y for kill (cut) and yank (paste) lines - those still work in emacs, so here are some emacs specific ones...
If you forget the command sequence for something, most things can be done through M-x command-name (such as M-x goto-line) or you can check what a key combination does with C-h k or M-x describe-key.
no subject
Date: Friday, 6 July 2007 05:06 (UTC)Oh, and
I assume you know the standard unix things like C-a & C-e for beginning and end of line, as well as C-k & C-y for kill (cut) and yank (paste) lines
No, I'm not familiar with those. Back when I used the Korn shell, I regularly used vi line editing rather than emacs line editing, and when I use the bash, I usually use cursor keys and Home/End, since that's usually worked so far. I think the only emacs command I've used on the command line is C-r to find a command in my history.
no subject
Date: Friday, 6 July 2007 10:50 (UTC)C-k will cut (kill) everything from the cursor to the end of the line (or multiple lines if you keep pressing it quickly). C-y will then paste (yank) that back out into the document at the current cursor position :)