Rocking the blogosphere

Emacs for beginners

Recommendations of things to try for a beginner

Emacs is a huge program with an amazing amount of functionality which can be quite intimidating to the beginner. Below is my attempt to mention the most important functionality IMHO so that someone coming from another editor can get a feel for what Emacs can do and whether it’s worth learning. It’s based on a comment that I left on a blog posting from a guy who was learning Emacs and wanted some direction.

Most importantly, C-x C-c (that’s Control-x followed by Control-c) quits Emacs. To save a file, C-x C-s. To load one, C-x C-f.

I’d start by learning the basic navigation commands like C-a, C-e, M-<, M->, etc. And you should also know that C-k kills lines and that C-SPACE is for marking a region. Once you’ve marked a region, use C-w to kill it or M-w to copy it and then use C-y to yank (paste it) and use M-y to cycle backwards through the “kill ring”. You will definitely also want to use incremental search which is bound to C-s by default. C-x 2 splits the window into two windows split vertically (C-x 3 is for horizontal) which can show different buffers. C-x 1 reduces to 1 window by making the current one the only one. C-x 0 kills the current window. Note that windows are not what you probably commonly think of windows; Emacs calls what you think of as windows “frames” :-) You also will need undo - C-_ (control+underscore) or C-x u. Also, C-g is used to abort operations.

As you get more advanced, you’ll want to look into fill-paragraph (M-q), find-tag (M-.), and macros, etc…..

The most important things to know, though, are how to get more information and Emacs is quite good here.

C-h k will tell you what function a particular Key sequence is bound to. The inverse is C-h w, which will tell you Where a particular command is on the keyboard. C-h f will describe a function. And super useful is the apropos command (C-h a) which lets you type a word or word fragment and Emacs will search functions and variables that have that word in the title. For example, do C-h a and then type “rect” and Emacs will tell you all the functions having to do with rectangles. The Info browser is also very cool - bound to C-h i by default (type ? to get help on how to use it).

Popularity: 2% [?]

No comments yet. Be the first.

Leave a reply