CPSC120A: Fundamentals of Computer Science
Fall 2011: Emacs Commands

Navigating

C-f            move cursor forward
C-bmove cursor backward
C-nmove cursor to next line
C-pmove cursor to previous line
C-lcenter screen on cursor
M-fmove cursor forward one token
M-bmove cursor backward one token
C-amove cursor to beginning of line
C-emove cursor to end of line
M-x goto-linego to line
C-vmove down one screenful
M-vmove cursor up one screenful
M-<move cursor to beginning of buffer
M->move cursor to end of buffer
M-amove cursor to beginning of statement
M-emove cursor to end of statement
M C-amove cursor to beginning of function
M C-emove cursor to end of function

Editing

<Backspace>delete character before cursor
C-ddelete character at cursor
M-<Backspace>delete from cursor to beginning of token
M-ddelete from cursor to end of token
C-kkill (cut) from cursor to end of line
C-yyank (paste) what was most recently killed
C-<SPC> set mark (mark is the beggining of region; cursor is end of region)
C-x C-pset region to entire buffer
C-wkill (cut) region
M-wsave (copy) region
C-c C-ccomment region
C-u C-c C-cun-comment region
<TAB>indent line
C-M-\indent region
C-_undo

Searching

C-sforward incremental search
C-rreverse incremental search
<RET> (when in search mode)stop searching
C-g (when in search mode)cancel search and return to where search started