Saturday, October 14, 2006

Emacs快捷键笔记

A good website for programming under Emacs:
http://www.cs.bu.edu/teaching/tool/emacs/programming/


推荐: 《GNU Emacs》 -Schoonover & Bowie & Arnold

M-%      Interactive Find and Replace

Ispell:

M-$      Check word's spelling
M-x spell-buffer    Check buffer's spelling
M-x spell-region    Check region's spelling


LISP

Modes:
M-x emacs-lisp-mode    Emacs-Lisp mode
C-x C-e      Evaluate preceding expression
C-M-x      Evaluate expression(contain the cursor or after)
M-x eval-region    Evaluate code in region
M-x eval-current-buffer   Evaluate all code in buffer

M-x lisp-interaction-mode    Emacs-interaction-lisp mode
C-j      Evaluate expression preceding the cursor

Moving Among Defuns:
C-M-a    Move to start of current or previous defun
C-M-e    Move to end of current or next defun
C-M-f    Move forward over the current or next sexp
C-M-b    Move backward over sexp
C-M-n    Move forward over list
C-M-p    Move backward over list
C-M-u    Move up a list
C-M-d    Move down a list

Marking Text:
C-M-h    Put region around defun
C-M-@    Puts a mark after the next sexp

Indentation & Comment:
C-j      Finish line and indent next
C-M-\    Indent all lines in region
C-M-q    Indent list contents
C-u TAB    Shift list to correct alignment
M-;      Append a comment to current line
C-u - C-x    Delete comment on current line
C-M-j    Finish current comment line and start a new comment

No comments: