Emacs: 神器 Org-mode
Org is a mode for keeping notes, maintaining TODO lists, and project planning with a fast and effective plain-text system.
It also is an authoring system with unique support for literate programming and reproducible research.
Org mode 称为神器一点都不为过,如果你平时工作内容有和文字处理相关的,绝对值得花一个月时间好好学习下 Emacs 中的 Orgmode。
关于 Org mode 在各方面使用的总结, 有很多优秀文章: GTD , Literate Programming , Cookbook , 当然也少不了经典的 Organize Your Life In Plain Text! .
本文旨在将平时收集使用的 snippets 汇总成 orgmode handbook, 方便同道中人随时取用。
Table of Contents
Beautify
如何隐藏 headlines 前面的一堆*符号?
(setq org-startup-indented t)
如何将 headlines 的符号从*变成其它符号?
(setq org-bullets-bullet-list '("☰" "☷" "☯" "☭"))
如何直接显示 加粗 、 删除线 、 强调
等样式?
(setq org-hide-emphasis-markers t)
如何设置 headline 的 TODO keywords?
;; "|"之前的为进行中的状态, 之后的为结束的状态 (setq org-todo-keywords '((sequence "TODO" "HAND" "|" "DONE")))
如何给 TODO keywords 增加前景色、背景色?
(setf org-todo-keyword-faces '(("TODO" . (:foreground "white" :background "#95A5A6" :weight bold)) ("HAND" . (:foreground "white" :background "#2E8B57" :weight bold)) ("DONE" . (:foreground "white" :background "#3498DB" :weight bold))))
配置效果如下图:

Capture-Refile-Archive
如何快速记录一些内容到指定文件?
;; 设置默认保存到哪个文件中 (setq org-default-notes-file "path/to/your/notes") ;; 设置快捷键来调用 org-capture (global-set-key (kbd "C-c c") 'org-capture)
如何设置不同的快速记录模板?
(setq org-capture-templates '(("p" ;;快捷键 "Personal" ;; 描述 entry ;; 填充类型为 heading (file+headline org-default-notes-file "Personal") "** TODO %?\n %i\n") ;; %?: 填完后光标所在位置 ;; %U: 非活跃的时间戳 ;; %i: 初始内容. 如果有选中区域, 即为该区域内容 ;; %a: 注释. 通常为 org-store-link 创建的链接 ("m" "Meeting" entry (file+headline "path/to/your/meeting/file" "Meetings") "** TODO %?\n %i\n") ("w" "Work" entry (file+headline org-default-notes-file "Work") "** TODO %?\n %i\n") ))
如何快速移动 headline 到指定文件中?
;; 设置移动到的目标文件列表为 agenda-files (setq org-refile-targets '((org-agenda-files :maxlevel . 3)))
More info: Aaron Bieber’s article
如何归档已完成事项到其它文件?
;; this is the default: current file is a.org, archive in file a.org_archive (setq org-archive-location "%s_archive")
location value | meaning |
---|---|
“::*Archived Tasks” | Archive in the current file |
under the top level headline | |
*Archived Tasks | |
“~/org/archive.org” | Archive in file ~/org/archive.org |
as top level trees | |
“~/org/archive.:datetree/” | datetree is special. the heading will |
be a subentry to the current date. | |
(there always need to be a “/” | |
after datetree) |
Tables
如何像 Excel 一样,在表格中插入 mini chart
?
;; while the cursor is on a column, ;; this command will create a new column ;; containing an ascii-art bars plot. M-x: orgtble-ascii-plot ;; this command insert a table formula: ;; (orgtbl-ascii-draw COLUMN MIN MAX WIDTH)
date | money | auto-inserted chart |
---|---|---|
20100101 | 9.92 | WWWWWWWWWH |
20100201 | 4.52 | WWWW! |
20210301 | 15.99 | WWWWWWWWWWWWWWWW |
Agendas
如何将 Agenda 中不同时间长度的事项显示不同的大小?
Dotfile Configuration 见 gist

如何设置 agenda 中时间的显示格式?
;; if set it to t, 9:30am would become 09:30. (setq org-agenda-time-leading-zero t)
如何隐藏 agenda 中的分隔线?
(setq org-agenda-use-time-grid nil)
如何在 agenda 中显示本地的日出日落时间?
- 相关 Dotfile configuration 见 gist
- 在 standard-dairy 文件中写入下面内容
;; content of file standard-diary ;;Day info ;; 日出而作, 日落而息 %%(diary-sunrise) %%(diary-sunset)
设置后的效果如下:
Day-agenda (W17): Tuesday 21 April 2020 05:29...... Sunrise 12:00-13:00 Scheduled: DONE 和 @XX 吃饭 1on1 18:58...... Sunset
Others
如何用 org 文件管理 RSS 订阅?
;; use an org file to organise feeds (use-package elfeed-org :ensure t :config (elfeed-org) (setq rmh-elfeed-org-files (list "/path/to/elfeed.org")))
More info: Pragmatic emacs’s article
如何在 org 中使用 PlantUML?
- 下载编译好的 PlantUML jar file
- 安装 Graphviz
brew install graphviz
- 配置可参考 这篇文章
如果平时画 UML 图比较多,建议多看下 Real-world-plantuml 这个网站的示例。

如何将PDF转化成org?
brew install poppler
Then , cd to the pdf directory:
pdftotext mypdf.pdf - >> mypdf.org