很多人说Emacs很神奇,我其实是从半年前开始使用Emacs的,用它就是用来在Linux下写代码。
Emacs到现在为止我只把他看作为一个编辑器,对应windows下的notepad。
因为是外包的项目所以都是通过Linux远程机的方式来进行编程,编译,调试,测试的。因为是维护项目,所以也没法用我老的办法在windows上用VC写好,调试好,最后Linux上编译,所以Emacs是项目一直使用的编程环境。
3天不摸手生,确实是有道理的,1个多月没用,很多的快捷键又忘记了,不过令人欣慰的是,虽然快捷键忘记了,但是我的手指还是记住了大部分的基本操作。今天再次看了下Emacs的Manual,虽然网上有很多类似的快捷键总结,但我这里还是来总结一下吧,免得自己又忘了:)因为用的Linux是无窗口的,所以也没装输入法,只能用半生不熟的英文写了。
Cursor:
C-v "next screen"
M-v "previous screen"
C-l "move text around cursor to center"
C-p "pre line"
C-b "backward" C-f "forward char"
M-b "back word" M-f "forward word"
C-n "next line"
C-a "begin of line" C-e "end of line"
M-a "begin of sentence" M-e "end of sentence"
M-< "begin of doc" M-> "end of doc"
Insert/Delete:
C-d "delete char"
M-d "delete word"
C-k "delete cursor to end of line"
M-k "delete cursor to end of sentence"
C-@/C-<SPC> "mark"
C-w "cut"
C-y "paste"
M-y "history paste"
Undo:
C-x U
C-'-'
Buffer:
C-x C-b "list all buffer"
C-x b "switch buffer"
File:
C-x C-f "find/open/create file"
C-x C-s "Save"
Exit:
C-x C-c "exit"
C-z "temporarily exit, back with 'fg'"
Window:
C-x 1 "just keep one window"
C-x 2 "up/down split window"
C-x 3 "left/right split window"
C-x o "switch window"
C-x left/right "switch window"
Repeat:
C-u + num + command "repeat command num times"
Search:
C-s word "search word"
C-r word "backward search"
Help:
C-h c command "get the description of the command"
C-h k command "get details of the command"
C-h f "command search"