美文网首页
org mode 笔记

org mode 笔记

作者: 顺ze | 来源:发表于2018-02-13 08:54 被阅读357次

    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

    1. subscripts and superscripts

    2. 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:

    1. Add a tag: HOME. C-c C-c

    2. Set a deadline. C-c C-d

    3. 插入一个未激活的时间戳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

    1. TODO Todo 1 (recommended org structure)

    2. Todo 2 (Most important thing you have to do)

    3. 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.
    1. To see unfinished todos, use `C-c / t`.

    Manage your tasks

    Automatically open your todo.org every time you start emacs

    1. `C-x C-f ~/.emacs.d/init.el` or `C-x C-f ~/.emacs`

    2. `M-S->` Go to end of the file.

    3. Add `(find-file "~/Dropbox/org/todo.org")`

    Managing TODO states

    1. Use `M-x customize-variable RET org-todo-keyworbds`.

    2. Change TODO to TODO(t) and DONE to DONE(d).

    3. Add TODO states such as WAITING(w), Make sure that the last state you have is DONE(d)

    4. Click `Apply and save`.

    5. 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.

    6. Use `C-c C-t`(M-x org-todo) to cycle through different states

    7. How to automatically archive cancelled tasks?

      1. Add (setq org-todo-state-tags-triggers '(("CANCELLED" ("ARCHIVE" . t)))) in ~/.emacs

      2. CANCELLED blabla

    8. See your unfinished tasks `C-c / t`.

    Org agenda

    1. 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.

    2. Schedule some tasks: Go to a task in todo.org, and `C-c C-s RET` to schedule the task for today.

    3. `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.

    4. `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.

    5. 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

    6. Automatically open agenda when starting emacs: `C-x C-f ~/.emacs.d/init.el`, add `(org-agenda nil "a")`

    7. '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

    1. org-clock-in `C-c C-x C-i`

    2. org-clock-out `C-c- C-x C-o`

    3. 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.

    4. org-clock-cancell: `C-c C-x C-q`

    5. 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.

    6. org-clock-last: `C-c C-x C-x`

    7. org-clock-update: `C-c C-x C-e`

      Update the effort estimate for the current clock task.

    8. org-clock-display: `C-c C-x C-d`

    9. 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

    1. .emacs配置

      (setq org-default-notes-file (concat org-directory "~/Dropbox/org/notes.org"))
      (define-key global-map "\C-cc" 'org-capture)
      
    2. 可以快速使用模版创建todo、记笔记等。`C-c c` (org-capture-template)

    3. Capture a todo with priority and tags

    4. Capture a web link for later reading, even email link with mu4e

    5. 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

    1. .emacs

      (require 'epa-file)
      (custom-set-variables '(epg-gpg-program  "/usr/local/bin/gpg"))
      (epa-file-enable)
      (setq epa-file-select-keys 0)
      
    2. 如果打算使用非对称加密方法,可以在需要加密的文件头添加

      -*- epa-file-encrypt-to: ("your@email.address") -*-
      

      其中your@email.address是使用gpg创建的密钥。

    3. EasyPG

    Encrypt Regions

    org-crypt

    1. 在Emacs中加密Org Mode文件

    2. 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上没试成功

    3. Decrypt

      将光标移动到需要解密的标题上
      M-x org-decrypt-entry
      解密后的内容将出现的Buffer中

    4. 取消加密

      为指定的标题删除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

    1. Never start to do anything before looking at the agenda view. 不要打开电脑漫无目的看QQ微信,刷微博知乎b站youtube等。

    2. All successful people have an agenda. (or a secretary who organize their time and maximize their value of their time).

    3. This is the key to long term success. (Goals, schedules, execution)

    What should be in org-agenda view?

    1. Important and urgent things goes first, they got A priority, along with important and not urgent tasks.
    2. 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

    1. This way you can track your time and effort. (with daily review and weekly review,根据这个反馈来反思和改变一些task的priority)
    2. All the benefits of pomodoro technique.(Focus)

    Weekly review and adjust the priority of todo items.

    1. 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?)

    1. notes, notes, notes

    2. the project schedule and due dates

    3. detailed log of actions and progress

    4. a complete specification of the steps taken in data analysis

    5. an article for publication

    6. a digital slide show

    7. a facility to track data aquisition graphically

    Exporting and Publishing

    1. HTML, so others can view it remotely in browser.

    2. LaTeX, as gateway to PDF, great for scientific notes

    3. Beamer presentation (also via LaTeX)

    4. ASCII, very readable email format (though org files are already readable)

    5. Sets of documents can be linked to a publishing project

    Scientific Project Example

    1. TODO Literature Study

      1. TODO SPIM

      2. TODO LFM

    2. TODO Discussion with Ling Fu

      1. TODO Idea 1: Super-thin lightsheet

      2. TODO Idea 2: Bessel light sheet

    3. Presentation

      1. Export in HTML/PDF for presentation

    Reproducible research

    1. Emacs+org-mode+python in reproducible research

    Questions

    DONE How to set repeated tasks(every sunday?)

    C-c C-s后,设置好时间后,直接编辑纯文本,添加上+1w或者.+1w即可。

    TODO org capture快捷键C-c c设置

    相关文章

      网友评论

          本文标题:org mode 笔记

          本文链接:https://www.haomeiwen.com/subject/pwturxtx.html