分类: LINUX
2008-04-05 04:43:36
(global-set-key [(prior)] '(lambda () "Previous" (interactive) (scroll-down 1)))或则
(global-set-key [(prior)] (function (lambda () "Previous" (interactive) (scroll-down 1))))记住对于 global-set-key函数需要的第二个参数是一个symble或者是list
(global-set-key (kbd "") (lambda () (interactive) (kill-buffer (current-buffer))))
M-x global-set-key
C-x i #插入一个文件的内容 C-x r #以只读的方式打开一个文件
M-% #确认替换
C-x ESC ESC #调出上一条复杂命令 C-x C-q #清除一个窗口的只读属性 M-/ #自动补齐 M-; #注释 C-c C-e #扩展宏 C-c C-\ #在当前区域的行尾加入"\"
`C-M-n' Move forward over a parenthetical group (`forward-list').
`C-M-p' Move backward over a parenthetical group(`backward-list').
`C-M-u' Move up in parenthesis structure (`backward-up-list').
`C-M-d' Move down in parenthesis structure (`down-list').
参数设置
int main() { int aa; unsigned int bb; double cc; }选择区域,让后M-x align即可
emacs -batch -f batch-byte-compile *.el
Keystrokes | Command name | Action |
C-x r k | kill-rectangle | Delete a rectangle and store it. |
C-x r d | delete-rectangle | Delete a rectangle and do not store it. |
C-x r y | yank-rectangle | Insert the last rectangle killed |
C-x r c |
clear-rectangle |
Using spaces, blank out the area marked as a rectangle and do not store it. |
C-x r o | open-rectangle | Insert a blank rectangle in the area marked. |
C-x r r r |
copy-rectangle-to-register |
Copy rectangle to register r (where r is any character) . |
C-x r i r |
insert-register |
Insert rectangle from register r (where r is any character). |
none) |
delete-whitespace-rectangle |
If a rectangle includes initial whitespace, deletes it, narrowing rectangle. |
C-x r t string Enter |
string-rectangle |
Change contents of marked rectangle to string (if string is narrower or wider than rectangle, dimensions change accordingly). |
(none) | string-insert-rectangle | Prompts for string and inserts rectangle. |
find ./ -name "*.[hc]" -type f -exec etags -a {} \;
C-x C-f RET /ftp:user@host:/path/test.txtssh方式: 下载plink.exe,将其路径加入PATH变量
C-x C-f RET /ftp:user@host:/path/test.txt
/su::/etc/foobar.conf
M-x list-colors-display
set-buffer-file-coding-system如果你想用另一种不同的编码打开文件:
revert-buffer-with-coding-system
emacs -nw如果你不想每次都这样麻烦,可以在bash里面设置alias.如在你的HOME目录下的.bashrc文件中加入下面一行
alias emacs='emacs -nw'
M-x query-replace-regexp ^^q [ret] [ret][note] ^^q的输入方式是 shift-6 C-q C-j
C-x C-f RET /plink:reality@10.0.0.99:/home/reality/test.txt
C-u M-! ls
C-x RET f unix #转化成Unix文件格式 C-x RET f dos #转化成dos文件格式
C-SPC #include... #include C-u 0 C-x a g includec RET now create a new buffer and type includec RET info/emacs/abbrevs for detail
以下是使您更快掌握 Emacs 的一些参考资料: