Sunday, March 18, 2007

Try Emacs

Emacs is the favorite editor of my leader, as well as my leader before. It looks handy and extensible. From Google Code, there is an emacs backend to enable navigation between source files. That's a good example that Emacs can be extended and customized for my need. I would like to have a try.

I read emacs build-in tutorial. It's basic but enough to start. There is a comprehensive manual from GNU emacs official website.

For starting, it's just different commands to vi or other editors. Just remember it.

^g reset emacs commands in case of hanging

^a / ^e move to the beginning or end of the line
ESC-< / ESC-> move to the beginning or end of the file
^k kill from cursor position to end of line
^ [SPACEBAR] or ^@ mark block
^w cut
ESC w copy
^y yank it back or paste

^s search or search again
^r reverse search or reverse search again
ESC % replace (type 'y' to confirm replacement)
No [RET] after entering search string

^x ^f open a file
^x ^s save current buffer
^x ^c exit
^x ^b list all buffers

^x u or ^_ undo
^u 8 repeat command for 8 times
^x 1 / 2 / o get rid of all other windows / split current window into two /switch to another window

All these commands work for both windows and Linux.

No comments: