Org-mode
Installation
`M-x package-install RET org RET`
`C-x C-f ~/Dropbox/todo.org`
Basics
Creat a New List: Option + RET
Use Tab(or M-left/right, M-S-left/right for list with hidden subtrees) to change * to **.
Tab to cycle subtree, S-Tab to cycle globally.
Add/delete/edit a todo item: Shift + left/right, or use C-c C-t to cycle through states.
Use M-up/down to arrange the list order (promote/demote).
Shift+up/down to set priority.
M-x org-version
M-x list-packages
Markup
-
subscripts and superscripts
-
italic
C-c C-x \ Toggle between showing entities as plain text and UTF8 characters. In addition to showing entities as UTF-8 characters, this command will also format sub- and superscripts in a WYSIWYM way.
Tags and deadline :HOME:
-
Add a tag: HOME. C-c C-c
-
Set a deadline. C-c C-d
-
插入一个未激活的时间戳C-c !
Code Block
快速插入easy-template: 输入 `<s Tab`
(message "天地玄黄,鸟生鱼汤")
Hyperlink
形式1: [[http://url][描述]]
形式2: [[http://url]]
Quote
引用的文字
Tables
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="left" />
<col class="left" />
<col class="left" />
</colgroup>
<tbody>
<tr>
<td class="left">Name</td>
<td class="left">Phone</td>
<td class="left">Room</td>
</tr>
<tr>
<td class="left"> </td>
<td class="left"> </td>
<td class="left"> </td>
</tr>
<tr>
<td class="left"> </td>
<td class="left"> </td>
<td class="left"> </td>
</tr>
<tr>
<td class="left"> </td>
<td class="left"> </td>
<td class="left"> </td>
</tr>
</tbody>
</table>
Examples
Tasks 1
-
TODO Todo 1 (recommended org structure)
-
Todo 2 (Most important thing you have to do)
-
DONE Todo 3 (Second important thing to do)
You can also take notes underneath each heading, like this
Tasks 2
Create todo List <code>[3/3]</code> :HOME:
- [X] eggs. Shift + left/right.
- [X] bacon. Use C-c C-c to mark the todo as done.
- [X] use <code>[0/0]</code> or <code>[0%]</code> to indicate the completion rate.
- To see unfinished todos, use `C-c / t`.
Manage your tasks
Automatically open your todo.org every time you start emacs
-
`C-x C-f ~/.emacs.d/init.el` or `C-x C-f ~/.emacs`
-
`M-S->` Go to end of the file.
-
Add `(find-file "~/Dropbox/org/todo.org")`
Managing TODO states
-
Use `M-x customize-variable RET org-todo-keyworbds`.
-
Change TODO to TODO(t) and DONE to DONE(d).
-
Add TODO states such as WAITING(w), Make sure that the last state you have is DONE(d)
-
Click `Apply and save`.
-
If you have your ~/todo.org open, go to that buffer and reload it with M-x org-mode so that it recognizes any new keywords and shortcuts you've debbfined.
-
Use `C-c C-t`(M-x org-todo) to cycle through different states
-
How to automatically archive cancelled tasks?
-
Add (setq org-todo-state-tags-triggers '(("CANCELLED" ("ARCHIVE" . t)))) in ~/.emacs
-
CANCELLED blabla
-
-
See your unfinished tasks `C-c / t`.
Org agenda
-
Add your todo.org to the list of files Org looks at when coming up with the agenda. Open your todo.org, and `C-c [` (org-agenda-file-to-front), this adds current file to the list.
-
Schedule some tasks: Go to a task in todo.org, and `C-c C-s RET` to schedule the task for today.
-
`C-c C-s +1` schedule the task for tomorrow, +2 for the day after tomorrow, 28 for the 28th, sat for Saturday, 1w for one week from now, 1m one month, 2tue two tuesdays from now, etc.
-
`M-x org-agenda RET a`, use `f` or `b` to go forward/backward, use `t` to change the todo state of a task, use `S-left/right` to reschedule the task earlier/later.
-
Refer to agenda easiefr, `C-x C-f ~/.emacs.d/init.el`, add `(global-set-key (kbd "C-c a") 'org-agenda)`, load configuration: `M-x eval-buffer`, now you can use `C-c a` to access your agenda.a
-
Automatically open agenda when starting emacs: `C-x C-f ~/.emacs.d/init.el`, add `(org-agenda nil "a")`
-
'C-c a` a agenda view; w week view; d day view; g rebuild agenda buffer. 在Org-Agenda view里,直接选中一个todo,按C-c C-t,即可设置todo/done等状态,按g刷新
Clocking work time
-
org-clock-in `C-c C-x C-i`
-
org-clock-out `C-c- C-x C-o`
-
org todo: `C-c C-t`
Changing the TODO state of an item to DONE automatically stops the clock if it is running in this same item.
-
org-clock-cancell: `C-c C-x C-q`
-
org-clock-jump: `C-c C-x C-j`
Jump to the entry that contains the currently running clock. With a C-u prefix arg, select the target task from a list of recently clocked tasks.
-
org-clock-last: `C-c C-x C-x`
-
org-clock-update: `C-c C-x C-e`
Update the effort estimate for the current clock task.
-
org-clock-display: `C-c C-x C-d`
-
org-clock-report: `C-c C-x C-r`
Insert a dynamic block containing a clock report as an Org-mode table into the current file. When the cursor is at an existing clock table, just update it.
Org Capture
-
.emacs配置
(setq org-default-notes-file (concat org-directory "~/Dropbox/org/notes.org")) (define-key global-map "\C-cc" 'org-capture)
-
可以快速使用模版创建todo、记笔记等。`C-c c` (org-capture-template)
-
Capture a todo with priority and tags
-
Capture a web link for later reading, even email link with mu4e
-
Capture a task with a source code file
Encrypt Files
Installation
brew install gnupg
(require 'epa-file) 编辑.emacs文件,激活EasyPG包。
在Emacs近期版本中(24.4)默认提供了EasyPG包。可以实现对GPG软件的调用,实现文件的加解密功能。
将需要加密的文件扩展名改为 gpg 就可以自动调用gpg软件进行文件的加解密了。
Setup
-
.emacs
(require 'epa-file) (custom-set-variables '(epg-gpg-program "/usr/local/bin/gpg")) (epa-file-enable) (setq epa-file-select-keys 0)
-
如果打算使用非对称加密方法,可以在需要加密的文件头添加
-*- epa-file-encrypt-to: ("your@email.address") -*-
其中your@email.address是使用gpg创建的密钥。
-
Encrypt Regions
org-crypt
-
Encrypt
编辑.emacs
(require 'org-crypt)
(org-crypt-use-before-save-magic)
(setq org-tags-exclude-from-inheritance (quote("crypt")))
(setq org-crypt-key nil) (or "Mesopotamian")设置gpg
gpg –gen-keys
Using gnupg-agent to Cache Your Passwords.
使用gpgconf查看配置
在emacs中使用M-x set-variable RET epg-Tab查看
目前有个bug,必须先在terminal中使用gpg -d test.gpg,手动输入一次密码,才能在emacs中加密解密
因为GPG的工作方式是:调用gpg>pinentry弹出密码输入窗口>gpg-agent缓存密码>emacs利用gpg-agent的缓存密码来工作,而这里的问题是emacs无法呼出pinentry,所以导致无法正常加密解密,elpa有pinentry声称可以在minibufer中输入密码,但是Mac上没试成功 -
Decrypt
将光标移动到需要解密的标题上
M-x org-decrypt-entry
解密后的内容将出现的Buffer中 -
取消加密
为指定的标题删除crypt标签,并保存即可。
Export
导出为markdown或者html等格式
添加到.emacs中 (setq org-export-backends (quote (ascii html icalendar latex md)))
C-c C-e
Application
How org-mode is being used today
Taking notes (开组会做记录,听讲座做记录等,看书看文献做笔记等)
Tasks and planning (日程管理,待做事件备忘,技能树管理,习惯养成等)
A small database (暂时不懂应用场景,后面有个科研相关的应用场景)
Basis for constructing web pages (我直接用HTML或者Markdown了,暂时不知道这里什么意思)
Use org-mode to manage your time
Org-agenda is your friend
-
Never start to do anything before looking at the agenda view. 不要打开电脑漫无目的看QQ微信,刷微博知乎b站youtube等。
-
All successful people have an agenda. (or a secretary who organize their time and maximize their value of their time).
-
This is the key to long term success. (Goals, schedules, execution)
What should be in org-agenda view?
- Important and urgent things goes first, they got A priority, along with important and not urgent tasks.
- A few habits to make you a great and healthy person.(helath, reading, blog, family,research, piano,etc)
When you start a task, clock in with pomodoro
- This way you can track your time and effort. (with daily review and weekly review,根据这个反馈来反思和改变一些task的priority)
- All the benefits of pomodoro technique.(Focus)
Weekly review and adjust the priority of todo items.
- You need only one todo.org file.
Keep an eye on what you have spent on each day, week, and month
Organizing a Scientist’s Life and Work
Tracking scientific projects (What can be done in a single document?)
-
notes, notes, notes
-
the project schedule and due dates
-
detailed log of actions and progress
-
a complete specification of the steps taken in data analysis
-
an article for publication
-
a digital slide show
-
a facility to track data aquisition graphically
Exporting and Publishing
-
HTML, so others can view it remotely in browser.
-
LaTeX, as gateway to PDF, great for scientific notes
-
Beamer presentation (also via LaTeX)
-
ASCII, very readable email format (though org files are already readable)
-
Sets of documents can be linked to a publishing project
Scientific Project Example
-
TODO Literature Study
-
TODO SPIM
-
TODO LFM
-
-
TODO Discussion with Ling Fu
-
TODO Idea 1: Super-thin lightsheet
-
TODO Idea 2: Bessel light sheet
-
-
Presentation
- Export in HTML/PDF for presentation
网友评论