Emacs shortcuts
Shortcuts
| shortcut | key-binding |
|---|---|
| go to beginning of file | M < |
| go to end of the file | M > |
| kill line to beginning | M 0 C-k |
| save all open buffers | C-x s |
| compare tree with base version | C-x v D |
| compare with base version | C-x v = |
| search for files with names matching a wildcard pattern | M-x find-name-dired |
Run grep via find |
M-x rgrep |
| Repeat last command | C-x z |
| Convert following word to lower case | M-l |
| Convert following word to upper case | M-u |
| Capitalize the following word | M-c |
| Convert region to lower case | C-x C-l |
| Convert region to upper case | C-x C-u |
Emacs macro Example
1 I am a random text
2 I am not
3 G, you've gone mad
4 Click on this link
5 Transfer in progress (we've started the transfer process)
6 But transfer happend yesterday
7 No you are
8 Oh please! this is getting too much!
9 I love emacs
10 I cant be bothered with this any more
11 its time to raise the bar
12 show me how to expand my territory
- Place cursor at first line
- Press
C-x (to start recording macro [At this point all your key inputs are being recorded so please follow the instructions carefully] - Press
C-ato go to the beginning of the line - Type "(" followed by
M-fto move forward a word and then type "," C-nto go to the next line, followed byC-x )to end the macroC-u 11 C-x erepeat the macro n (11 in this case) times
change to:
(1, I am a random text
(2, I am not
(3, G, youve gone mad
(4, Click on this link
(5, Transfer in progress (weve started the transfer process)
(6, But transfer happend yesterday
(7, No you are
(8, Oh please! this is getting too much!
(9, I love emacs
(10, I cant be bothered with this any more
(11, its time to raise the bar
(12, show me how to expand my territory
浙公网安备 33010602011771号