Emacs tutorial notes 4 November 2002 Mike Daniels Conventions: C-x means hold down the control key and press x S-x means hold down the shift key and press x M-X means hold down the meta key and press x OR press Escape, and then press x Note that C-S-x and C-X are the same thing. Files: C-x C-f opens files C-x i inserts a file C-x C-s saves a file C-x C-w saves a file with a different name Cursor navigation: C-a - beginning of line C-e - end of line C-f - forward character C-b - backward character M-f - forward word M-b - backward word C-n - next line C-p - previous line M-< - top of buffer M-> - end of buffer C-v - page down M-v - page up To bring emacs' cursor movement in line with windows conventions: M-x pc-selection-mode Undo: C-x u OR C-_ Cancel: C-g The basic help system: C-h i What does this key do? C-h k What command is appropriate for doing X? C-h a Selection: Use mouse to highlight, OR Type C-{SPACE} at the beginning of the region and move the cursor to the end OR M-h - select current paragraph C-x h - select entire buffer C-x C-p - select entire page Things to do with selected text: C-k - cut M-w - copy M-x print-region - print Use any command with "region" in its name. Paste: C-y Search and replace: C-s - incremental search C-M-s - incremental regexp-based search M-% - interactive search and replace C-M-% - interactive regexp-based search and replace Interactive search-and-replace: {SPACE} replace and continue OR y {DELETE} skip and continue OR n {RETURN} skip and stop OR q . replace and stop ! replace all ^ back up Window management: C-x b [buffername] - create a buffer, or switch to an existing one C-x 4 b [buffername] - do the above in another window C-x 5 b [buffername] - do the above in another frame C-x k [buffername] - get rid of buffer C-x 2 - split vertically C-x 3 - split horizontally C-x o - move to other window C-M-v - scroll other window (without moving to it) C-x {zero} - delete current window C-x {one} - delete other windows Frame management: C-x 5 2 - make new frame C-x 5 b [buffername] - put or create buffername in a new frame C-x 5 0 - get rid of frame C-x 5 o - move to other frame C-x 5 1 - delete other frames Customization: M-x customize Modes: C-h m - describe current modes Emacs at home: Emacs for windows can be obtained here: ftp://ftp.gnu.org/gnu/windows/emacs/latest/ See http://www.gnu.org/software/emacs/windows/ for installation instructions. Emacs for mac can be obtained here: http://mac-emacs.sourceforge.net/ Remote editing: C-x C-f /user@host:path/file