EN
GNU Emacs is the most popular and most ported Emacs text editor. It was created by GNU Project founder Richard Stallman. In common with other varieties of Emacs, GNU Emacs is extensible using a Turing complete programming language.
CN
EMACS,即 Editor MACroS(编辑器宏)的缩写,最初由 Richard Stallman(理查德·马修·斯托曼) 于 1975 年在 MIT 协同 Guy Steele 共同完成。这一创意的灵感来源于 TECMAC 和 TMACS,它们是由 Guy Steele、Dave Moon、Richard Greenblatt、Charles Frankston 等人编写的宏文本编辑器。
Emacs 使用 Emacs Lisp,这种有着极强扩展性的编程语言,从而实现了包括编程、编译乃至网络浏览等等功能的扩展。
$ emacs -nw filename
Table 1: Prefix
| Prefix | Description |
|---|---|
| C | Ctrl |
| M | Alt |
| S | Shift |
| RET | Enter |
| up/down/left/right | 上/下/左/右 方向键 |
| C-c | 当前编辑模式特有的命令 |
| C-x | 文件和缓冲区命令 |
| C-h | 获取帮助命令 |
| M-x | 键入函数名称前缀快捷键 |
Table 2: general shotkeys
| Keyboard | Description | Keyboard | Description |
|---|---|---|---|
| C-x C-c | Exit | C-g | Exit the command being excuted |
| C-v | 查看下一屏 | M-v | 查看上一屏 |
| C-l | 重绘屏幕,并将光标所在行置于屏幕的中央 | ||
| C-f | 向右移(forward,前进) | C-b | 向左移(backward,回退) |
| C-p | Previous line | C-n | Next line |
| M-f | 向右移(以单词为一个单位) | M-b | 向左移(以单词为一个单位) |
| M-< | 移动到所有文字最开头 | M-> | 移动到所有文字的最末尾 |
| C-a | Move custor to line head | C-e | Move custor to line tail |
| M-a | Move custor to sentence head | M-e | Move custor to sentence tail |
| C-k | Delete content after custor | C-y | Paste |
| C-/ | Cancel | C-x u | Cancel |
| C-d | Delete character after custor | M-w | Copy |
| C-d | Delete character after custor | M-w | Copy |
| C-SPACE | Select content model | C-w | Cut |
| C-x C-f | Open/New file | C-x C-s | Save |
| C-x 2 | 分屏 | C-x 0 | Switch to window 1 |
| C-x o | Switch window | C-h t | Help |
Table 3: File
| Keyboard | Description |
|---|---|
| C-x C-f | Open/New file |
| C-x C-s | Save |
| C-x C-w | Save as |
| C-x C-v | Close the current buffer file, and open file |
| C-x i | Insert file at current position |
| C-x b | New/Switch buffer |
| C-x C-b | Show buffer lists |
| C-x k | Close buffer |
| C-x C-c | Exit emacs |
Table 4: Move
| Keyboard | Description |
|---|---|
| C-f | 光标向后移动 |
| C-b | 光标向前移动 |
| C-p | Previous line |
| C-n | Next line |
| M-f | 光标移动到单词尾部 |
| M-b | 光标移动到单词头部 |
| C-a | Head of line |
| C-e | End of line |
| C-v | 向下翻页 |
| M-v | 向上翻页 |
| M-< | 到文件开头 |
| M-> | 到文件结尾 |
Table 5: Text Edit
| Keyboard | Description |
|---|---|
| M-n/C-u n | 重复执行后一个命令 n 次 |
| C-d | 删除后一个字符 |
| M-d | 删除前一个字符 |
| Del | 删除前一个字符 |
| M-Del | 删除前一个单词 |
| C-k | 移除一行 |
| C-@ | 设定标志位(主要是为了粘贴剪切以及删除使用) |
| C-w | 移除标记区域的内容(剪切) |
| M-w | 复制标记区域的内容(复制) |
| C-y | 粘贴 |
| M-y | 召回更早的内容 (在 kill 缓冲区内循环) |
| C-t | 交换两个字符的位置 |
| M-t | 交换两个单词的位置 |
| C-x C-t | 交换两行的位置 |
| M-u | 使从光标位置到单词结尾处的字母变成大写 |
| M-l | 与 M-u 相反 |
| M-c | 使从光标位置开始的单词的首字母变为大写 |
| M-x mark-whole-buffer or C-x h, M-x indent-region or C-M-\ | 选中整个文件,然后格式化 |
| M-x mark-defun or C-M-h, M-x indent-region or C-M-\ | 选中函数,格式化 |
Table 6: Search
| Keyboard | Description |
|---|---|
| C-s | 向前搜索 |
| C-r | 向前搜索 |
| M-% | 查找及替换:首先按下快捷键,输入要替换的词,RET,然后输入要替换的词,RET |
Table 7: Window
| Keyboard | Description |
|---|---|
| C-x 2 | 水平分割窗格 |
| C-x 3 | 垂直分割窗格 |
| C-x o | 切换至其他窗格 |
| C-x 0 | 关闭窗格 |
| C-x 1 | 关闭除了光标所在窗格外所有窗格 |
Table 8: Help
| Keyboard | Description |
|---|---|
| C-h m | Show current mode |
| C-h c | 显示快捷键绑定的命令 |
| C-h k | 显示快捷键绑定的命令和它的作用 |
| C-h f | Show feature of function |
| C-h b | 显示当前缓冲区所有可用的快捷键 |
| C-h t | Open emacs tutorial |
| M-x quit | Exit help |
| M-x org-entities-help | Org mode entities 特殊字符参考 |
Emacs 快速设置生效命令:
M-x eval-buffer
不小心按了 ctrl + Z 挂起后,恢复命令
$ fg
Org mode is for keeping notes, maintaining TODO lists, planning projects, and authoring documents with a fast and effective plain-text system.
ORG 是一个快速高效的纯文本系统,可用于记日记、维护待办事项列表、计划项目以及撰写和发布文档。
read more: https://orgmode.org/
Table 9: org-mode keyboard
| Keyboard | Description |
|---|---|
| TAB (org-cycle) | Cycle visibility. 循环切换光标所在大纲的状态 |
| RET | enter,Select this location. |
| C-c C-n (org-next-visible-heading) | Next heading. |
| C-c C-p (org-previous-visible-heading) | Previous heading. |
| C-c C-f (org-forward-same-level) | Next heading same level. |
| C-c C-b (org-backward-same-level) | Previous heading same level. |
| C-c C-u (outline-up-heading) | Backward to higher level heading. |
| C-c C-j | 切换到大纲浏览状态 |
| C-c C-' | 源码编辑或源码编辑完成退出 |
| M-RET (org-meta-return) | Insert a new heading, item or row. 插入一个同级标题 |
| C-RET (org-insert-heading-respect-content) | Insert a new heading at the end of the current subtree. |
| M-LEFT/RIGHT | 将当前标题升/降级 |
| M-S-LEFT/RIGHT | 将子树升/降级 |
| M-S-UP/DOWN | 将子树上/下移 |
#+TITLE: GNU Emacs
*粗体*
/斜体/
+删除线+
_下划线_
下标:H_2 O(这里必须留一个空格要不然 2 和 O 都成为小标,目前还不知道怎么去掉空格)
上标:E=mc^2
等宽字: =git=,~code~
使用 \\ 换行
空一行代表重新起段落
| 快捷键 | 说明 |
|---|---|
| S-TAB | 循环切换整个文档的大纲状态(折叠、打开下一级、打开全部) |
| TAB | 循环切换光标所在的大纲状态 |
| 快捷键 | 说明 |
|---|---|
| C-c C-n/p | 移动到下上一个标题(不断标题是哪一级) |
| C-c C-f/b | 移动到同一级别的下/上标题 |
| C-c C-u | 跳到上一级标题 |
| C-c C-j | 切换到大纲预览状态 |
| 快捷键 | 说明 |
|---|---|
| M-RET | 插入一个同级别的标题 |
| M-S-RET | 插入一个同级别的 TODO 标题 |
| M-LEFT/RIGHT | 将当前标题升/降级 |
| M-S-LEFT/RIGHT | 将子树升/降级 |
| M-S-UP/DOWN | 将子树上/下移动 |
| C-c * | 将本行设为标题或者正文 |
| C-c C-w | 将子树或者区域移动到另一个标题处(跨缓冲区) |
| C-c C-x b | 在新缓冲区显示当前分支 |
| C-c / | 只列出包含搜索结果的大纲,并高亮,支持多种搜索方式 |
#+begin_src c -n -t -h 7 -w 40
...
#+end_src
c 为所添加的语言
-n 显示行号
-t 清除格式
-h 7 设置高度为 7
-w 40 设置宽度为 40
#+BEGIN_COMMENT
块注释
...
#+END_COMMENT
#+CAPTION: This is the caption for the next table (or link)
则在需要的地方可以通过 \ref{table1} 来引用该表格。
#+BEGIN_EXPORT html
All lines between these markers are exported literally
#+END_EXPORT
#+INCLUDE: "~/.emacs" src emacs-lisp
| H: | 标题层数 |
| num: | 章节(标题) 是否自动编号 |
| toc: | 是否生成索引 |
| creator: | 是否生成 "creat by emacs…" |
| LINKUP: | UP: 链接 |
| LINKHOME: | HEME: 链接 |
| 操作 | 说明 |
|---|---|
| C-c 竖线 | 创建或者转化成表格 |
| C-c C-c | 调整表格,不移动光标 |
| TAB | 移动到下一区域,必要时新建一行 |
| S-TAB | 移动到上一区域 |
| RET | 移动到下一行,必要时新建一行 |
| 快捷键 | 说明 |
|---|---|
| M-LEFT/RIGHT | 移动列 |
| M-UP/DOWN | 移动行 |
| M-S-LEFT/RIGHT | 删除/插入列 |
| M-S-UP/DOWN | 删除/插入行 |
| C-m | 移动到下一行,或新建一行 |
| C-c - | 添加水平分割线 |
| C-c RET | 添加水平分割线并跳到下一行 |
| C-c ^ | 根据当前列排序,可以选择排序方式 |
| C-c ` | 编辑当前单元格 |
| C-c C-x C-w | 剪切某个区域的表格内容 |
| C-c C-x C-y | 拷贝复制的内容到表格 |
| 数量 | 单价 | 总额 |
|---|---|---|
| 2 | 3.45 | 6.9 |
| 4 | 4.34 | 17.36 |
| 5 | 3.44 | 17.2 |
| 5 | 5.6 | 28. |
C-u C-c C-c 强制 org-mode 为整个表格进行设计。只希望在某一特定项上进行计算,输入:':=$1*$2′, 即在等号前再加一个冒号。
<5> 表示指定列的宽度,超出宽度的部分会用=>表示,如果想要编辑,需要按下 C-c ` ,会打开另一个 buffer 让你编辑, 用 C-c C-c 提交编辑内容。
<l> 表示左对齐,r,c,l 字符分别表示右、中和左对齐。
在一个链接上按 C-c C-o 即可访问。
[[link][description]]
[[link]]
#<<target>>
设置到 target 的链接:[[target]] 或 [[target][猛击锚点]]
注脚的格式有两种,一是方括号+数字,二是方括号+fn+名字。插入脚注:C-c C-x f ,接下俩你可以写一些其他东西,然后在文章的末尾写上下面两句话(注意:必须要顶格写):
[1] The link is: http://orgmode.org
[fn:orghome] The link is: http://orgmode.org
五条短线或以上
#+FILETAGS: :Peter:Boss:Secret:
更方便的做法是在正文部分用 C-c C-q 或直接在标题上用 C-c C-c 创建标签
使用#+TAGS 元数据进行标记, #+TAGS: { 桌面(d) 服务器(s) } 编辑器(e) 浏览器(f) 多媒体(m) 压缩(z)
每项之间必须用空格分隔,可以在括号中定义一个快捷键;
花括号里的为标签组,只能选择一个对标签定义进行修改后,要在标签定义的位置按 C-c C-c 刷新才能生效。
(setq org-tag-alist '((:startgroup . nil)
("@work . ?w) ("@home" . ?h)
("@tennisclub" . ?t)
(:endgroup . nil)
("laptop" . ?l) ("pc" . ?p)))
默认情况下,org 会动态维护一个 Tag 列表,即当前输入的标签若不在列表中,则自动加入列表以供下次补齐使用。为了使这几种情况(默认列表、文件预设 tags,全局预设 tags)同时生效,需要在文件中增加一个空的 TAGS 定义:'#+TAGS:'
| 快捷键 | 说明 |
|---|---|
| C-c \ | 可以用来查找某个 tag 下的所有项目 |
| C-c / m | 搜索并按树状结构显示 |
| C-c a m | 从所有 agenda file 里建立符合某 tag 的全局性列表 |
+ 和 a+b 同时有这两个标签
- 排除 a-b 有 a 但没有 b
| 或 a|b 有 a 或者有 b
& 和 a&b 同时有 a 和 b,可以用“+”替代
M-x org-entities-help <RET>
#+NAME:<name>
#+BEGIN_SRC <language> <switches> <header arguments>
<body>
#+END_SRC
// 注意:9.2 版本后,需要在 emacs 初始化文件中,写入 (require 'org-tempo)
// 快速输入 #+BEGIN_SRC ... #+END_SRC
<s <TAB>
// 快速输入 #+BEGIN_EXAMPLE ... #+END_EXAMPLE
<e <TAB>
// 快速输入 #+BEGIN_EXPORT html ... #+END_EXPORT
输入<h <TAB>
// 快速输入 #+BEGIN_EXPORT latex ... #+END_EXPORT
<l <TAB>
<s #+BEGIN_SRC … #+END_SRC
<e #+BEGIN_EXAMPLE … #+END_EXAMPLE
<q #+BEGIN_QUOTE … #+END_QUOTE
<v #+BEGIN_VERSE … #+END_VERSE
<c #+BEGIN_CENTER … #+END_CENTER
<l #+BEGIN_LaTeX … #+END_LaTeX
<L #+LaTeX:
<h #+BEGIN_HTML … #+END_HTML
<H #+HTML:
<a #+BEGIN_ASCII … #+END_ASCII
<A #+ASCII:
<i #+INDEX: line
<I #+INCLUDE: line
示例:安装 plantuml 插件
M+x package-install <RET>
plantuml-mode <RET>
示例:安装 monokai-pro 主题(手动安装)
// 将添加到 ~/.emacs 或 ~/.emacs.d/init.el 文件
(add-to-list 'load-path "~/.emacs.d/lisp/")
(require 'plugin-name)
查看所有安装包
M+x list-packages <RET>
自动卸载无效的包
M+x package-autoremove <RET>
修改主题
M-x customize-themes <RET>
安装 MacTex 及相关工具包
ORG Mode 使用 MacTex 发布 PDF 以及 Tex 格式文档,可直接运行如下命令安装 MacTex :
$ brew cask install mactex
sudo tlmgr install environ
sudo tlmgr install trimspaces
sudo tlmgr install zhnumber
sudo tlmgr install ctex
sudo tlmgr install needspace
sudo tlmgr install xecjk
安装 pandoc
ORG ox-pandoc 模块使用 pandoc 发布 (exporting) .org 文档至众多 pandoc 支持的格式。
$ brew install pandoc
安装 graphviz 和 PlantUML 包
ORG 模块 ditaa 使用 Graphviz 和 PlantUML 包支持纯文本作图,特别是 UML 各类图的制作。
$ brew install ditaa graphviz plantuml
Table 18: General plugins
| Name | Description |
|---|---|
| htmlize | export to html. |
| org | |
| org-plus-contrib | |
| planuml-mode | PlanUML |
| emmet-mode | Emmet plugin |
PlantUML 是一个快速创建 UML 图形的组件。下面是一个简单的示例:
;; #+BEGIN_SRC plantuml :file {{site.url}}/assets/images/orgmode-babel-sequenceuml.png
;; Alice -> Bob: synchronous call
;; Alice ->> Bob: asynchronous call
;; #+END_SRC

在线 Demo 服务(link:http://www.plantuml.com/plantuml/)
$ sudo apt install graphviz
1: ;; Load plantuml
2: (setq org-plantuml-jar-path
3: (expand-file-name "~/.emacs.d/plantuml/plantuml.jar"))
最后在 ~/.emacs 或 ~/.emacs.d/init.el 中,添加配置语言。
1: ;; active Org-babel languages
2: (org-babel-do-load-languages
3: 'org-babel-load-languages
4: '(;; other Babel languages
5: (plantuml . t))) ;; add this line
M-x package-install <RET>
plantuml-mode <RET>
M-x customize-variable <RET>
plantuml-jar-path <RET>
简单示例
顺序图用 -> , –>, <-, <– 来绘制参与者(Participants)之 间的消息(Message)。

应用举例 1
标题、参与者、别名、注释、箭头、图形图例位置、消息序号、颜色、分割图形
参与者
使用 participant 关键词,也可以使用下面的参与者分类关键词来申明参与者:
箭头样式
图形图例(Legend the diagram)
使用 legend 和 end legend 关键词可以设置图例为左对齐、右对齐和居中对齐。
分割图形(Splitting diagrams)
关键词 newpage 是用来把图形分割成几个图片的。每一个被分割出来的 图片可以看作是一个新的页面( new page ),如果要给新的页面添加一 个标题,可以紧跟在关键词 newpage 之后来设置。
' 要给图形加一个标题可以用 title 关键词来设置。
title Simple Comunication example
actor Bob
boundary Lily #red
control Linus #blue
entity Michael
database "Edward's"
' The only defference between actor and participant is the drawing
participant Alice
participant "I have a really\nlong name" as L #99ff99
/' You can also declare:
participant L as "I have a really\nlong name" #99ff99
'/
' 消息序号(Message sequence numbering):
' 使用 autonumber 给消息添加序号
autonumber
' 如果需要指定一个起始号码,可以直接在 autonumber 后面加个数字就行 了,如果要设置自增量,再在后面加一个数字就行了(autonumber start increment)
' autonumber 15
' autonumber 40 10
' 也可以为序号指定数字格式,这个格式化的过程实际上是 Java 类 DecimalFormat 来执行的( 0 表示数字, # 缺省补零位数)。同样的,也可以使用一些 HTML 标签来控制数字的样式。
' autonumber "<b>[000]"
' autonumber 15 "<b>(<u>##</u>)"
' autonumber 40 10 "<font color=red>Message 0 "
Bob -[#red]-> Lily : To boundary
Bob -[#0000FF]->> Linus : To control
Bob -\ Michael : To entity
Bob //-- Edward : To database
Bob \\- Alice
Bob ->o Alice
Linus -> Alice : Authentication Request
Alice -> Linus : Authentication Response
Linus -> Linus : This is a signal to self.\nIt also demonstrates\nmultiline \ntext
Bob \\-Alice
Bob <-> Alice
Bob <<-\\o Alice
newpage A title for the\nlast page
legend right
Short
legend
endlegend

应用举例 2:消息(Message)
消息分组(Grouping)
可以使用下面的关键词来实现:
上面的关键词后可以添加一些文本用来显示在头部(注: group 除外,因为它后面的文本用来显示在组名称的位置)。在组嵌套组的结构里可以用关键词 end 来关闭组或者说是表示一个组符号的结束符(类似 if/endif )。
消息注解(Notes)
使用 note left 或 note right 关键词
其他的注解方式(Some other notes)
通过使用关键词 note left of , note right of 或 note over,可以把注解放置在与之相关的参与者的左边或右边,或下方。如果要使用多行注解,可以使用关键词 end note 来表示注解的结束。
Alice -> Bob: Authentication Request
note left: this is a first note
alt successful case
Bob -> Alice: Authentication Accepted
else some kind of failure
Bob -> Alice: Atuhentication Failue
group My own label
Alice -> Log : Log attack start
loop 1000 times
Alice -> Bob: DNS Attack
end
Alice -> Log : Loag alice end
end
else Another type of failue
Bob -> Alice: Please repeat
note right of Alice: This is displayed right of Alice.
note over Bob, Alice
This is yet another
example of
a long note.
end note
end
Log -> Log
note right
a note
can also be defined
on several lines
end note

应用举例 3:使用 HTML 进行格式化(Formatting using HTML)
可以使用少量的 HTML 标签来格式化文本:
participant Alice
participant "The <b>Famous</b> Bob" as Bob
Alice -> Bob : A <i>well formated</i> message
note right of Alice
This is <back:cadetblue><size:18>displayed</size></back>
<u>left of</u> Alice.
end note
note left of Bob
<u:red>This</u> is <color #118888>displayed</color>
<b><color purple>left of</color> <s:red>Alice</strike> Bob</b>
end note
note over Alice, Bob
<w:#FF33FF>This is hosted</w> by <img ../img/code.png>
end note

用例
用例可以用一对小括号括起来表示,也可以使用 usecase 关键词来定义,用例也可以通过使用 as 关键词来设置别名。
参与者(Actors)
定义参与者时,可以把参与者的名称放在两个冒号的中间,也可以用 actor 关键词来定义参与者。同样参与着也可以使用别名。

完整示例 1(Complete Example)
<b>
<i>
<font size="nn"> or <size:nn> to change font size
<font color="#AAAAAA"> or <font color="colorName">
<color:#AAAAAA> or <color:colorName>
<img:file.png> to include an image
title Simple example\nof title
skinparam activityStartColor red
/'
skinparam backgroundColor #DDD
skinparam activityBarColor SaddleBrown
skinparam activityEndColor Silver
skinparam activityBackgroundColor Peru
skinparam activityBorderColor Peru
skinparam activityFontName Impact
skinparam activityShape octagon
'/
(*) --> [You can put also labels] "First Activity"
note right: This activity has to be defined
--> "this <size:20>activity</size>
is <b>very</b> <color:red>long</color>
and defined on serveral lines
that contains many <i>text</i>" as A1
--> ===B1===
if " Some Test" then
-->[ture] "Some Activity" as someAct
--> "Another Activity" as act1
partition checkActivity
act1 -> if "Activited" then
-down->"Access Home"
-right-> (*)
else
-left->"Activiting"
-->"waiting"
-->someAct
endif
act1 -> if "error" then
-->"throw"
-->(*)
else
--> "record log"
-->(*)
endif
end partition
else
->[false] "Something else"
-->[Ending process] (*)
endif

完整示例 2
'http://click.sourceforge.net/images/activity-diagram-small.png
title Servlet Container
(*) --> "ClickServlet.handleRequest()"
--> "new Page"
if "Page.onSecurityCheck" then
->[true] "Page.onInit()"
if "isForward?" then
->[no] "Process controls"
if "continue processing?" then
-->[yes] ===RENDERING===
else
-->[no] ===REDIRECT_CHECK===
endif
else
-->[yes] ===RENDERING===
endif
if "is Post?" then
-->[yes] "Page.onPost()"
--> "Page.onRender()" as render
--> ===REDIRECT_CHECK===
else
-->[no] "Page.onGet()"
--> render
endif
else
-->[false] ===REDIRECT_CHECK===
endif
if "Do redirect?" then
->[yes] "redirect request"
--> ==BEFORE_DESTORY===
else
if "Do Forward?" then
-left->[yes] "Forward request"
--> ==BEFORE_DESTORY===
else
-right->[no] "Render page template"
--> ==BEFORE_DESTORY===
endif
endif
--> "Page.onDestory()"
-->(*)

完整示例 1
Beta 版本的活动图简化了活动图的符号定义,从 V7947 这个版本开始, PlantUML 就开始引入了一些简化写法,当然到目前(20140627)为止还不是 很完善,但这个版本里的一些简化写法已经是 PlantUML 后续版本的发展方向。在使用新的写法之前需要把 GraphViz 更新到最新版本。
' : 开始
start
note left: This is start
if (graphviz installed?) then (yes)
#purple:process all\ndiagrams;
if (multiprocessor?) then (yes)
fork
:Treatment 1;
fork again
:Treatment 2;
end fork
else (monoproc)
:Treatment 1;
:Treatment 2;
endif
elseif (graphviz installed on linux?) then (yes)
:enable linux;
repeat
:read data;
:generate diagrams;
repeat while (more data?)
else (no)
:process only
__sequence__ and __activity__ diagrams;
while (data available?) is (not empty)
:read data;
:generate diagrams;
end while (empty)
endif
end

完整示例 2
start
:ClickServlet.handleRequest();
:new page;
if (Page.onSecurityCheck) then (true)
:(Page.onInit();
if (isForward?) then (no)
:Process controls;
if (continue processing?) then (no)
stop
endif
if (isPost?) then (yes)
:Page.onPost();
else (no)
:Page.onGet();
endif
:Page.onRender();
endif
else (false)
endif
if (do redirect?) then (yes)
:redirect process;
else
if (do forward?) then (yes)
:Forward request;
else (no)
:Render page template;
endif
endif
stop

Table 19: Default key bindings
| 快捷键 | 描述 |
|---|---|
| C-c C-c | plantuml-preview: renders a PlantUML diagram from the current buffer in the best supported format |
| C-u C-c C-c | plantuml-preview in other window |
| C-u C-u C-c C-c | plantuml-preview in other frame |
注意:在通过 PlantUML 组件画图时,目前的解决办法只能是:先指定生成图片的地址,执行生成操作,然后改为站点访问地址,最后执行发布。具体操作如下:
先指定特定生成图片地址
#+BEING_SRC plantuml :file ../../_assets/example.png
...
#+END_SRC
执行生成操作 https://github.com/skuro/plantuml-mode
改写为访问地址
#+BEGIN_SRC plantuml :file {{site.url}}/assets/images/example.png
...
#+END_SRC
$ vim ~/.bashrc
LC_CTYPE="zh_CN.utf8"
$ sudo vim /etc/environment
LC_CTYPE="zh_CN.utf8"
问题描述
Warning (server): Unable to start the Emacs server
There is an existing Emacs server, named "server".
To start the server in this Emacs process, stop the existing
server or call ‘M-x server-force-delete’ to forcibly disconnect it.
问题解决
打开 init.el 或 .emacs 文件,注释以下代码:(这只是临时解决办法,肯定有更好的解决方式,暂时未找到)
(server-start)
(setq server-socket-dir "~/.emacs.d/server")
参考资料
问题描述
M-x org-publish <RET> jekyll-zhaorengui-github-io
font-lock-fontify-keywords-region: Error in syntax table logic for to-the-end intervals
问题解决
#+BEGIN_SRC php
echo date('Y-m-d', strtotime(date('Y-m-01') . ' -1 month')); // 计算出本月第一天再减一个月
#+END_SRC
修改为
#+BEGIN_SRC php
// 计算出本月第一天再减一个月
echo date('Y-m-d', strtotime(date('Y-m-01') . ' -1 month'));
#+END_SRC

