页面

2009-04-11

emacs cheat sheet

  1. Bookmark:
    C-x r m
    C-x r b
  2. Uppercase initial:
    upcase-initials-region
  3. 搜索当前位置的单词:
    C-s C-w
  4. 搜索性质的高亮:
    C-s C-w C-w ...
  5. 复制矩形块区域(即列选择)
    C-x r r register_name
    C-x r i register_name
  6. 复制区域
    C-x r s register_name
    C-x r i register_name
  7. 删除矩形区
    M-x delete-rectangle
  8. 保存位置及返回(非书签方式)
    C-x r SPC register_name
    C-x r j register_name
  9. see manual for perfectly printing
  10. 高亮:
    C-x w h
    C-x w r
  11. Indent multiple lines (within a region):
    C-M-\
  12. Indent multiple lines (within a parenthesized programming expression block):
    C-M-q
  13. Resize current window (not the frame):
    C-x ^ # to make the current windows taller
    C-x { # to make it wider
  14. eshell mode operations:
    M-p # Fetch the next earlier old shell command.
    M-n # Fetch the next later old shell command.
    M-r regexp RET # Search backwards for old shell commands that match regexp.
    M-s regexp RET # Search forwards for old shell commands that match regexp.
    C-c C-x # Fetch the next subsequent command from the history.
  15. Reload file (which actually is a trick):
    C-x C-v RET
  16. Kill job in eshell mode:
    C-c C-k
  17. Validate XML:
    C-c C-v
    Maybe, an XML parser is required:
    $ aptitude install sp
  18. Show key-binding and help of current mode:
    C-h m
  19. Transpose text:
    C-t # 2 characters
    M-t # 2 words
    C-x C-t # 2 lines
  20. Temparorily key-binding to a script
    M-x local-set-key RET key RET command RET
  21. Highliting parenthesis
    M-x show-paren-mode
  22. Yanking to mini-buffer as searching
    C-s M-y
  23. Toggling buffer with read-only
    C-x C-q
  24. 折行:
    M-q
    C-x f # set column width
    M-x fill-region
    M-x fill-region-as-paragraph
    M-s # center a line
    M-x auto-fill-mode # automatic mode
    M-x set-fill-column # adjust column number for auto-fill-mode
  25. goto-line
    M-g g
  26. Show column number:
    M-x column-number-mode
  27. Completion:
    M-/

没有评论: