2014年12月2日星期二

Emacs Shortcuts

**** 1. File
ctrl+x, ctrl+f Open file
ctrl+x, ctrl+s Save
ctrl+x, ctrl+w Save As
ctrl+x, s Save All
ctrl+x, ctrl+v Revert to File
meta+x Revert Buffer
ctrl+x, k Close Window/Buffer
ctrl+x, ctrl+c Quit

**** 2. Edit
ctrl+_ Undo
C-/ Undo
C-x u Undo
ctrl+space Begin Selection
ctrl+g Cancel Selection
ctrl+w Cut Selection
ctrl+k Cut Line
ctrl+y Paste
ctrl+x r s / # Copy Selection to Numbered Clipboard
ctrl+x r i / # Paste from Numbered Clipboard
delete Delete
ctrl+d Fwd delete
meta+delete Delete Word
meta+d Fwd Delete Word
C-S-backspace  kill-whole-line.

**** 3. Cursor Movement
meta+f / meta+b Word forward / backward
ctrl+a / ctrl+e Line forward / backward
meta+{ / meta+} Paragraph forward / backward
ctrl+v / meta+v Page forward / backward
meta+< / meta+> Document forward / backward
meta+ctrl+a / meta+ctrl+e C Function forward / backward

**** 4. Search
ctrl+s Incremental search
ctrl+r Incremental search reverse
meta+ctrl+s Regexp incremental search
meta+ctrl+r Regexp incremental search reverse
meta+% Interactive Search and Replace
meta+x goto-line Goto Line Number
meta+ctrl+b (or esc ctrl+B) Previous Matching Bracket
meta+ctrl+f (or esc ctrl+F) Next Matching Bracket

C-s C-s Search for most recently searched item
C-s M-p Previous item in search history
C-s M-n Next item in search history
C-h k C-s Guide to more commands available in incremental search

**** 5. Window
ctrl+x,k Close
ctrl+x, b Next Window
ctrl+x, ctrl+b Choose Window
ctrl+x, 1 Maximize
ctrl+x, 2 Split Horizontal
ctrl+x, 3 Split Vertical
ctrl+x, o Switch Focus Between Windows
meta+` Activate Menu Bar

**** 6. Registers
ctrl+xr s (#) Copy Selection to Numbered Clipboard
ctrl+x r i (#) Paste from Numbered Clipboard
ctrl+x r space (#) Set Numbered Bookmark
ctrl+x r j / # Jump to Numbered Bookmark

**** 7. Formatting
meta+q Re-flow Paragraph
meta+ctrl+\ Indent Selection
meta+u Uppercase Word
meta+l Lowercase Word
meta+c Capitalize Word
ctrl+x, ctrl+u Uppercase Selection
ctrl+x, ctrl+l Lowercase Selection

**** 8. Macros
ctrl+x, ( Start Recording
ctrl+x, ) Stop Recording
ctrl+x, e Play Macro
meta+# Repeat command # times
ctrl+u (#) Repeat command # times

**** 9. Others
C-x z                 # repeat last command
z                     # repeat last command again.
                      # Press z as many times as you wish.
                      # Any other key acts normally, and ends the repeat command.

指定目录的图片2值化

```python # -*- coding: utf-8 -*- """指定目录的图片,自适应2值化 """ import os from PIL import Image import numpy as np imp...