Search Site

Feed Section

Thursday, September 3, 2009



A Quick and Subtle Introduction to Emacs

Posted: 03 Sep 2009 09:16 AM PDT

Emacs is a feature-rich, powerful, and highly extensible traditional text editor that is popular among hardcore programmers and veteran UNIX/Linux users. It was written by Richard M. Stallman in 1976 and is still being actively developed up to this day. --As of July 2009, the latest stable release of GNU Emacs is version 23.1.

To those of you who are interested in learning Emacs, perhaps this quick and subtle introduction to some of its most important commands and keyboard shortcuts may help:


Starting Emacs:
Launching Emacs in shell terminal-
$emacs
Launching Emacs without X support-
$emacs -nw

Notation:
A keyboard shortcut like C-c M-x k is interpreted as ``press CTRL and c - release keyboard - press ALT and x - release keyboard - press k''. M- designates the ALT key, which in Emacs terminology is denoted the metakey. Another way to invoke the metakey in M-x is to ``press ESC - release keyboard - press x''.

Resetting and Undoing:
C-g resets command input buffer
C-x u undoes previous command

Moving Around:
C-n go to next line
C-p go to previous line
C-f go to next character
C-b go to previous character
C-a go to the begining of the line
C-e go to the end of the line
M-b back one word
M-f forward one word

Deleting, Cutting, Copying, and Pasting:
C-d delete one character forward
C-w cut the currently selected text, also copy it
C-k delete or cut from the cursor position until the end of the line
C-y pastes previous cut text
M-d delete one word forward
M-DEL delete one word backward

Dealing with files:
C-x C-f opens a file
C-x C-w saves current file.

Searching:
C-r search backward
C-s search forward

RTFM (Read The Fine Manual) and Tutorial:
C-h i runs the Info program that browses structured documentation files of Emacs
C-h t opens Emacs tutorial

No comments:

Post a Comment