Emacs Org Mode Notes

STARTUP options

org-startup-options is a variable defined in ‘org.el’.

Variable associated with STARTUP options for org-mode. Each element is a list of three items: the startup options (as written in the #+STARTUP line), the corresponding variable, and the value to set this variable to if the option is found. An optional forth element PUSH means to push this value onto the list in the variable.

Its value is shown below (frequently used):

Value: (("fold" org-startup-folded t)
 ("overview" org-startup-folded t)
 ("nofold" org-startup-folded nil)
 ("showall" org-startup-folded nil)
 ("showeverything" org-startup-folded showeverything)
 ("content" org-startup-folded content)
 ("indent" org-startup-indented t)
 ("noindent" org-startup-indented nil)
 ("hidestars" org-hide-leading-stars t)
 ("showstars" org-hide-leading-stars nil)

Property syntax

Properties are key-value pairs. When they are associated with a single entry or with a tree they need to be inserted into a special drawer (see The Org Manual Section 2.8 [Drawers], page 15) with the name PROPERTIES. Each property is specified on a single line, with the key (surrounded by colons) first, and the value after it. Here is an example:

* CD collection
** Classic
*** Goldberg Variations
:PROPERTIES:
:Title: Goldberg Variations
:Composer: J.S. Bach
:Artist: Glen Gould
:Publisher: Deutsche Grammophon
:NDisks: 1
:END:
C-c C-x p

Set a property. This prompts for a property name and a value. If necessary, the property drawer is created as well.

Drawers

Sometimes you want to keep information associated with an entry, but you normally don’t want to see it. For this, Org mode has drawers. Drawers need to be configured with the option org-drawers. Drawers look like this:

** This is a headline
Still outside the drawer
:DRAWERNAME:
This is inside the drawer.
:END:
After the drawer.

You can interactively insert drawers at point by calling org-insert-drawer, which is bound to C-C C-X D. With an active region, this command will put the region inside the drawer. With a prefix argument, this command calls org-insert-property-drawer and add a property drawer right below the current headline. Completion over drawer keywords is also possible using M-TAB.

Checkboxes

Every item in a plain list[^1] can be made into a checkbox by starting it with the string ‘[ ]’.

Checkboxes are not included in the global TODO list, so they are often great to split a task into a number of simple steps.

Here is an example of a checkbox list.

* TODO Organize party [2/4]
- [-] call people [1/3]
  - [ ] Peter
  - [X] Sarah
  - [ ] Sam
- [X] order food
- [ ] think about what music to play
- [X] talk to the neighbors

The ‘[2/4]’ and ‘[1/3]’ in the first and second line are cookies indicating how many checkboxes present in this entry have been checked off, and the total number of checkboxes present. This can give you an idea on how many checkboxes remain, even without opening a folded entry.

You have to insert the cookie yourself by typing either ‘[/]’ or ‘[%]’. With ‘[/]’ you get an ‘n out of m’ result, as in the examples above. With ‘[%]’ you get information about the percentage of checkboxes checked (in the above example, this would be ‘[50%]’ and ‘[33%]’, respectively).

The following commands work with checkboxes:

C-c C-c

Toggle checkbox status or (with prefix arg) checkbox presence at point. With a single prefix argument, add an empty checkbox or remove the current one[^2]. With a double prefix argument, set it to ‘[-]’, which is considered to be an intermediate state.

M-S-RET

Insert a new item with a checkbox. This works only if the cursor is already in a plain list item

C-c #

Update the statistics cookie in the current outline entry. When called with a C-u prefix, update the entire file. Checkbox statistic cookies are updated automatically if you toggle checkboxes with C-c C-c and make new ones with M-S-RET.

Export

CSS for Org-exported HTML

#+STYLE: <link rel="stylesheet" type="text/css" href="org.css" />

How to export Org mode files into awesome HTML in 2 minutes

#+SETUPFILE: theme-bigblow.setup

Lines starting with zero or more whitespace characters followed by one ‘#’ and a whitespace are treated as comments and, as such, are not exported.

Insert code blocks

https://emacs.stackexchange.com/questions/19945/command-to-insert-code-block

#+BEGIN_EXAMPLE
#+BEGIN_SRC
#+END_SRC
#+END_EXAMPLE

Inline code

https://stackoverflow.com/questions/16186843/inline-code-in-org-mode

utf-8 bullets for org-mode

https://github.com/sabof/org-bullets


Reference:

  • The Org Manual, page 65-67
  • The Org Manual, page 72-73
  • The Org Manual, page 25

[^1]: With the exception of description lists. But you can allow it by modifying org-list-automatic-rules accordingly.

[^2]: C-u C-c C-c on the first item of a list with no checkbox will add checkboxes to the rest of the list.

转载于:https://my.oschina.net/tshulamite/blog/1625426

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值