emacs 从入门到入门

摘要:
1、 请参阅MasterEmacsin21Days II。键盘映射(Mac)2.1。原始映射M(eta)、选项键s(uper)和左命令键s(shift)C(trl)2.2。修改ctrl键CapsLock。使用Shift+修改项目2的默认配置。将左侧选项修改为元键III。移动光标3.1个字符/单词C-f向前移动一个字符,f向前移动C-b向后移动,b向后移动

emacs 从入门到入门第1张

一、参考

Master Emacs in 21 Days

二、键盘对应(Mac)

2.1 原始对应

M(eta), Option 键

s(uper), 左 Command 键

S(Shift)

C(trl)

2.2 修改 ctrl 键

emacs 从入门到入门第2张

CapsLock 使用 shift + 实现

emacs 从入门到入门第3张

修改 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.

免责声明:文章转载自《emacs 从入门到入门》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇VASP+Phono3py计算声子linewidthscrapy抓取所有网站域名下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

emacs不能使用中文输入法

参考 http://blog.csdn.net/nomasp/article/details/52138501 根据Fcitx的介绍:当LC_CTYPE为英文时,在Emacs上可能无法使用输入法。 : 打开下面文件中的一个就行 , 在文件结尾添加如 1 emacs /home/用户名/.bashrc LC_CTYPE="zh_CN.utf8" 2 s...

emacs下最牛逼的Markdown编辑方式

将一些和MarkDown相关的快捷键用一张图表示:    这是Markdown-mode官网。 很多人喜欢用Markdown编辑文档和博客,这里提供一些配置,使得emacs用户能够在自己的编辑器中实现编辑文档并实时查看效果,甚至可以很方便的转换成为PDF格式。   1.安装     首先安装Markdown-mode这个package。可以再MELPA上去...

Emacs 安装配置使用教程

Emacs 安装配置使用教程 来源 https://www.jianshu.com/u/a27b97f900f7 序|Preface 先来一篇有趣的简介:Emacs和Vim:神的编辑器和编辑器之神 - 51CTO.COM 为何写这篇教程? 作为一个彻头彻尾的emacs新手,尽管有些薄弱的编程经验,但上手这么一个黑客级别的编辑器还是难免一段阵痛期。虽然网...

Emacs的undo与redo

在Emacs的手册16.1节中有这样一句话, Any command other than an undo command breaks the sequence of undo commands. Starting from that moment, the entire sequence of undo commands that you have j...

Emacs org批量生成HTML手册

效果展示: 我们花时间去考虑使用org生成HTML形成的静态网页到底长什么样子: 如上图, 看上去是一个干干净净的界面, 有列表内容, 标题, 图片等等. 但它的强大远远不止于此, 它还可以套入MathJax来完美的渲染数学公式. 如果用它用于整理笔记, 无疑这是一个轻便, 简洁并且十分强大的笔记软件. 看完以上效果, 好, 那让我们一起开始制作一个or...

转:windows下安装emacs

最近在学习windows下的Emacs,遇到不少问题,比如什么home目录啦,.emacs配置文件啦,.el文件啦,通过几天的反复琢磨,终于有所感悟。我想不仅是我,很多人都遇到过这些问题,现在就总结如下,以供有需要的朋友参考。1、下载到这个网址可以下载到Emacs的windows版本:http://ftp.gnu.org/pub/gnu/emacs/win...