Allosaurus' Den Almost geek.

Simple Org-mode user guide

| 644 words | Emacs Org-mode note

Simple Org-mode user guide

Headings

* Top level Heading
  * Second level Heading
    * Third level Heading

Top level Heading

Second level Heading

Third level Heading

Motion

C-c C-n/p

Jump to next/previous heading(can be different level).

C-c C-f/b

Jump to next/previous heading(same level).

Visibility

C-x n s/w

s for narrow buffer to current subtree only. w for cancel narrowing. By default, the first time you enter a org file with emacs, it will only show the overview, which means you can only see the hightest level headings… (You can modify this of course) Org uses two command: Tab and S-Tab to fold and unfold region in the doc. Move the cursor to a heading, press Tab and see what happen!

Tab

Tab is local cycling. You can press Tab more times to see the visibility change between: Folded view: show the current heading only. Children view: show the current heading’s children. Subtree view: show anything below the heading(including heading itself).

S-Tab

S-Tab is global cycling. Overview: show all highest level headings. Content: show all the headings. Show all: literally meaning.

You can use sparse tree utility to show the outline of the doc you want!

C-c / r

Prompts for a regexp and shows a sparse tree with all matches. Tips: You can use M-x show-all to see full outline.

Structure editing shortcuts

M-RET

Insert a heading.

M-S-RET

Insert a new to-do heading.

M-LEFT/RIGHT

Promote/demote a heading.

M-S-LEFT/RIGHT

Promote/demote a subtree.

M-UP/DOWN

Move a subtree up/down one level.

C-c C-x C-w

Cut a subtree

C-c C-x M-w

Copy a subtree

Lists

-   A simple unordered list item

This is a simple unordered list.

-   You can also use '+'
-   **description list item:** this type is unordered.
-   A simple ordered list item.
-   Another simple ordered list item.

  • A simple unordered list item

This is a simple unordered list.

  • You can also use ‘+’
  • description list item: this type is unordered.
  • A simple ordered list item.
  • Another simple ordered list item.

Blocks

usually for code

Text

#+begin_src example
Some text from a text file.
#+end_src
Some example from a text file.

Code

#+begin_src python
def func():
        # Here goes some magic...
    print(func())
#+end_src
    def func():
        # Here goes some magic...
    print(func())
#+begin_src emacs-lisp -n 20
   ;; This exports as line number 20
   (message "this is line 21")
#+end_src
    20  ;; This exports as line number 20
    21  (message "this is line 21")

Tables

| Col1  | Col2          | Col3      |
|-------+---------------+-----------|
| Item1 | description 1 | example 1 |
| Item2 | description 2 | example 2 |

You can use C-c C-c to align tables. In fact, org table has more features than you thought it has. It works just like a full-functioning spread sheet!

This is a link:

[[https://www.google.com][Link to google]]

Link to google

#+LINK: google https://google.com/search?q=%s
[[google:emacs][search emacs on google]]

search emacs on google

To-do items

* TODO a simple to-do item.
    :LOGBOOK:
    - State "NEXT"       from "DONE"       [2020-03-07 Sat 10:10]
    - State "DONE"       from "NEXT"       [2020-03-07 Sat 10:10]
    :END:
* NEXT a simple next item.
* DONE a simple done
    CLOSED: [2020-03-07 Sat 10:11]
    :LOGBOOK:
    - State "DONE"       from "NEXT"       [2020-03-07 Sat 10:11]
    :END:

S-Left/Down

Select the current to-do item state.

Checkboxes

TODO simple checkboxes [2/4]

*** TODO simple checkboxes [2/4]
    - [-] to-do item 1 [1/3]
      - [] to-do item 1-1
      - [x] to-do item 1-2
      - [] to-do item 1-3
    - [x] to-do item 2
    - [] to-do item 3
    - [] to-do item 4

Markup for rich content

Emphasis and monospace

You can make word *bold*, /italic/, _underlined_, =verbatim=, ~code~, and +strike-through+

Special symbols

For example:
Pro tips: Given a circle \Gamma of diameter d, the length of its
circumference is \pi{}d.

For example: Pro tips: Given a circle Γ of diameter d, the length of its circumference is πd.

Unless otherwise noted, the content of this site is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).