Helpful Shortcuts while using Emacs

If you're running X windows, start emacs with "emacs file &". If you're on a terminal (or telnet) window use "emacs -nw file" The file name is optional.

(C-x) means "hold down the control key and press x".
(M-x) means "press the escape key followed by x". (Alternatively M-x can be often be obtained by holding down the alt key and hitting x.)


Navigation
(C-p) move back a line
(C-n) move to the next line
(C-f) move forward a character
(C-b) move back a character
(C-a) move to beginning of line
(C-e) move to end of line
(C-v) move forward a screenful
(M-v) move back a screenful
(M-<) goto beginning of buffer
(M->) goto end of buffer
(M-g) line no goto the specified line no
Using Frames
(C-x) 0 Closes the current frame, without killing the buffer
(C-x) 1 Closes all other frames, bringing the current frame to the front
(C-x) 2 Splits current frame horizontally
(C-x) 3 Splits current frame vertically
(C-x) o Move between the frames
(C-x) b Switch between buffers in current frame
(C-x) k Kill buffer in current frame
(C-x) (C-b) Opens/Updates a buffer window listing all current buffers
(C-x) (C-f) Opens a new buffer in the current frame
Editing
(C-l) redraw current buffer
(C-x) u undo the effect of the last command
Backspace delete the character before the cursor
(C-d) delete the character after the cursor
(C-k) move the rest of the line to a new temporary buffer/ existing temporary buffer is appended to
(C-y) paste contents of the (C-k) buffer
(C-space) begin selection of text in buffer
(C-w) move contents of selected text to the (C-k) buffer
(M-w) copy contents of selected text to the (C-k) buffer
(C-x) i Insert a file into the buffer
(M-q) "justify" the current paragraph, that is, redo the line breaks in the current paragraph)
Find and Replace
(C-s) (string) specify a string to search for (in cureent buffer)
(C-r) (string) specify a string to search backwards for (in cureent buffer)
(C-s) (C-s) search for the string previously searched for
(C-r) (C-r) (similar)
(M-x) query allows you to do the query-replace command on the file which can replace any string by any other. On each occurrence it allows you to decide whether or not to do the replacement.
(M-x) replace-string same as above, but does not query--just does it all
Compiling/Running Java programs in Emacs
(C-c) (C-v) (C-c) Compiles the Java file in the current buffer
(C-c) (C-v) (C-r) Runs the compiled version of the current buffer
Opening and Saving Buffers
(C-x) (C-f) opens the specified file
(C-x) (C-s) save the current buffer in its associated file (creates file if it does not exist)
(C-x) (C-w) write out the buffer in the current frame to the specified file
Exiting/Suspending Emacs
(C-x) (C-c) Exits Emacs
(C-z) Suspends Emacs
Using the unix shell from Emacs
(C-q) (any keystroke) send keystroke to shell instead of being interpreted by emacs
(M-x) shell open a shell prompt in the current frame
(M-p) Put the last shell command on the current line of shell (this does what C-p does in a typical unix shell)
(M-n) (similar)
Troubleshooting
(C-g) help Aborts any command that you've partially specified
(M-x) blah? list all the possible completions to the string "blah" that are valid commands
(M-x) help Help on commands and key bindings

Thanks to Bryan Chen for helping set up all of this

Some more help is available if you type emacs -help at the command prompt. I haven't explored that yet... I will update this page as I learn more... Rohit