emacs 的基本操作

2 篇文章 0 订阅
1 篇文章 0 订阅

配置参考自: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-a Move to beginning of line
M-m Move to the first non-whitespace character on the line
C-e Move to end of line
C-f Move forward one character
C-b Move backward one character
M-f Move forward one word (I use this a lot)
M-b Move backward one word (I use this a lot, too)
C-s Regex search for text in the current buffer and move to it. Hit C-s again to move to the next match
C-r Same as above, but search in reverse
M-< Move to beginning of buffer
M-> Move to end of buffer
M-g g Go to line
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


选择/区域

C-spc  M-f

代换操作

M-x 


Here's a summary of key bindings:

C-w Kill region
M-w Copy region to kill ring
C-y Yank
M-y Cycle through kill ring after yanking
M-d Kill word
C-k Kill 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 b switch-to-buffer-other-window 在另一个窗口打开缓冲
C-x 4 C-o display-buffer 在另一个窗口打开缓冲,但不选中
C-x 4 f find-file-other-window 在另一个窗口打开文件
C-x 4 d dired-other-window 在另一个窗口打开文件夹
C-x 4 m mail-other-window 在另一个窗口写邮件
C-x 4 r find-file-read-only-other-window 在另一个窗口以只读方式打开文件
C-x 0 delete-window 关闭当前窗口
C-x 1 delete-other-windows 关闭其它窗口
C-x 4 0 kill-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)


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值