一、参考
二、键盘对应(Mac)
2.1 原始对应
M(eta), Option 键
s(uper), 左 Command 键
S(Shift)
C(trl)
2.2 修改 ctrl 键
CapsLock 使用 shift + 实现
修改 item2 默认的配置,将 left option 修改为 meta 键
三、光标移动
3.1 字符/单词
C-f 为前移一个字符, f 代表 forward
C-b 为后移一个字符, b 代表 backward
M-f 前移一个单词
M-b 后移一个单词
DEL Delete the character just before the cursor
C-d Delete the next character after the cursor
M-DEL Kill the word immediately before the cursor
M-d Kill the next word after the cursor
3.2 一行/行间
C-a 为移至行首, a 代表 ahead
C-e 为移至行尾, e 代表 end
C-p 为上移至前一行, p 代表 previous
C-n 为上移至下一行, n 代表 next
M-a 为移至段首, a 代表 ahead
M-e 为移至段尾, e 代表 end
C-k Kill from the cursor position to end of line
M-k Kill to the end of the current sentence
删除一个区域: kill a segment of text:
type C-SPC, move the cursor to the other end of the text you intend to kill, Finally, type C-w
3.3 screen
C-v, move forward one screen
M-v, move backwards one screen
C-l, Clear screen and redisplay all the text, moving the text around the cursor to the center of the screen
3.4 文件
C-x C-f 为打开目标文件, f 代表 find/file
C-x C-s 为保存当前缓冲区(Buffer), s 代表 save
M-<, moves to the beginning of the whole text
M->, moves to the end of the whole text
3.5 window
C-x 1 保留一个窗口 One window (i.e., kill all other windows)
3.6 C-x 其他常用键
(1) C-x C-c 退出 emacs
C-x C-c offers to save each changed file before it kills Emacs.
(2) 打断组合键为 C-g, 用于终端取消之前的指令, STOPS RESPONDING
(3) C-u 8 C-f 向前移动 8 个字符
(4) C-y 粘贴最近剪切内容 It reinserts the last killed text,
C-y would yank the more recent kill
(5) M-y 粘贴非最近剪切的内容
replaces that yanked text with the previous kill
(6) C-/ 撤销操作 undoes the changes made by one command
(7) C-z is the command to exit Emacs temporarily--so that you can go back to the same Emacs session afterward.
(8) C-x u Undo
(9) C-s to start a search
(10) C-r for reverse search
3.7 M-x 其他常用命令
(1) M-x recover-this-file 恢复文件
(2) M-x auto-fill-mode 设置 auto fill 功能
3.8 不同点
(1) The difference between "killing" and "deleting":
"killed" text can be reinserted (at any position), whereas "deleted" things cannot be reinserted in this way (you can, however, undo a deletion--see below).
Reinsertion of killed text is called "yanking"
四、内置功能
4.1 开启行号
M-x linum-mode 编辑器内显示行号
4.2 获取帮助
C-h k 寻找快捷键的帮助信息
例如:
C-h k C-f
See how this window shrinks, while a new one appears to display documentation on the C-f command
C-h v 寻找变量的帮助信息
C-h f 寻找函数的帮助信息
C-h t 获取 tutorial 文档
C-h m 查看当前模式的说明文档
C-h C-a For information about GNU Emacs and the GNU system
五、buffer
5.1 基本命令
C-x C-b List buffers
C-x b bufferName 切换到具体的 buffer
C-x s Save some buffers
六、模式 mode
Emacs has many different major modes.
6.1 基本命令
(1) M-x fundamental-mode
is a command to switch to Fundamental mode.
七、frames
7.1 基本命令
(1) C-x 2 which splits the screen into two windows
(2) C-M-v to scroll the bottom window
Without leaving
the selected window, you can scroll the text in the other window with
C-M-v.
(3) C-x o ("o" for "other") to move the cursor to the bottom window
(4) C-x 4 C-f followed by the name of one of your files.