emacs 的基本操作

来源:互联网 发布:淘宝数据魔方多少钱 编辑:程序博客网 时间:2024/05/17 00:06

配置参考自:http://www.braveclojure.com/basic-emacs/

 C+g  取消当前的动作

 缓存区的操作

C-x b 进行缓冲区的操作

C-x k 关闭一个缓冲区


操作文件

C-x C-f  打开文件

C-x C-s  保存文件


-----------------------------------------------------------------

总结:

  1. In Emacs, editing takes place in buffers
  2. To switch to a buffer, do C-x b and enter the buffer name in the minibuffer
  3. To create a new buffer, do C-x b and enter a new buffer name
  4. To open a file, do C-x C-f and navigate to the file
  5. To save a buffer to a file, do C-x C-s.
  6. To create a new file, do C-x C-f and enter the new file's path. When you save the buffer, Emacs will create the file on the file system.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

移动操作

C-aMove to beginning of lineM-mMove to the first non-whitespace character on the lineC-eMove to end of lineC-fMove forward one characterC-bMove backward one characterM-fMove forward one word (I use this a lot)M-bMove backward one word (I use this a lot, too)C-sRegex search for text in the current buffer and move to it. Hit C-s again to move to the next matchC-rSame as above, but search in reverseM-<Move to beginning of bufferM->Move to end of bufferM-g gGo to line--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


选择/区域

C-spc  M-f

代换操作

M-x 


Here's a summary of key bindings:

C-wKill regionM-wCopy region to kill ringC-yYankM-yCycle through kill ring after yankingM-dKill wordC-kKill line

窗口操作

按键

命令

作用

C-x 2

split-window-vertically

垂直拆分窗口

C-x 3

split-window-horizontally

水平拆分窗口

C-x o

other-window

选择下一个窗口

C-M-v

scroll-other-window

滚动下一个窗口

C-x 4 bswitch-to-buffer-other-window在另一个窗口打开缓冲C-x 4 C-odisplay-buffer在另一个窗口打开缓冲,但不选中C-x 4 ffind-file-other-window在另一个窗口打开文件C-x 4 ddired-other-window在另一个窗口打开文件夹C-x 4 mmail-other-window在另一个窗口写邮件C-x 4 rfind-file-read-only-other-window在另一个窗口以只读方式打开文件C-x 0delete-window关闭当前窗口C-x 1delete-other-windows关闭其它窗口C-x 4 0kill-buffer-and-window关闭当前窗口和缓冲C-x ^enlarge-window增高当前窗口C-x {shrink-window-horizontally将当前窗口变窄C-x }enlarge-window-horizontally将当前窗口变宽C-x -shrink-window-if-larger-than-buffer如果窗口比缓冲大就缩小C-x +balance-windows所有窗口一样高 windmove-right切换到右边的窗口(类似:up, down, left)


原创粉丝点击