12/08/2018, 15:47

Introduction to Org-mode

Org-mode is a personal information management and outlining tool for Emacs. This document is a documentation of what I learn in ord-mode Obtaining org mode Org-mode is part of Emacs 22 and above. Configuration Make sure org-mode get load and add some basic global key combinations: ...

Org-mode is a personal information management and outlining tool for Emacs.

This document is a documentation of what I learn in ord-mode

Obtaining org mode

Org-mode is part of Emacs 22 and above.

Configuration

Make sure org-mode get load and add some basic global key combinations:

(require 'org)
(define-key global-map "C-cl" 'org-store-link)
(define-key global-map "C-ca" 'org-agenda)
(setq org-log-done t)

Creating a new file

With the previous configuration, Emacs will enter org-mode whenever it visits or create file with the extensiong “.org”

Simple task list

In org-mode, TODO items are always headlines.

To change TODO status, move the cursor to the TODO line and hitting C-c C-t, which runs the command org-todo.

To add more to do items, move cursor to a new line and hit M-shift-RET to call org-insert-todo-heading. It can be hit serveral times.

Using headlines to structure a document

The best way to organized ideas is an outline

Each star equal to one level of heading.

Emphasis and monospace

You can make words bold using *text*,

italic using italic ,

underlined using _underlined_ ,

verbatim using =verbatim=

code using ~code~

strike-through’ using '+strike-through+'

Plain lists

  • To add an unordered plain list, start the line with - or +.

  • To make Org-mode add a - or + at the start of subsequent list items automatically, use M-Return to insert the next list item.

  1. To add an ordered list, start the line with 1.,

  2. to make Org-mode number subsequent items automatically, use M-Return to insert the next list item.

  3. Org-mode automatically renumbers the list items if it is added in the middle of an ordered list.

To add checkboxes, start the list item with -[ ]

Links to other places

Syntax to add link:

[[link][description]]
Exp
[[google.con][google]]

To open the link, move the cursor over the link and hit C-c C-o for org-open-at-point

To link a local file, visit the file then hit C-c l to call org-insert-link

Tables

Org-mode includes a table editor. Using `|` as a column separator, Org-mode automatically reformats the plain-text table to realign columns or add new rows.

Exp:

1 2 3

Use Tab to move to the next cell and Shift-Tab to move to the previous cell.

You can do spreadsheet calculations in these plain-text tables by inserting formulae within cells.

Overviews of a document

To get an overview from the document, press shift-Tab. Only the top level heading are shown. Hit shift-Tab again to show all heading (include TODO) then hit again for normal view of the document.

Global TODO list

Setup: First, set the variable org-agenda-files so that org-mode will know which files to search for TODOs and scheduled items.

(setq org-agenda-files (list "~/org/work.org"
                             "~/org/school.org"
                             "~/org/home.org"))

Press C-c a t to enter the global todo list. Org-mode will scan the files in org-agenda-files and present a listing of all the open TODO items.

The TODO item can be marked as complete by pressing /“t”/ or jump to its source file by hitting RET.

Scheduling tasks and using the agenda

Move cursor to the TODO item and hit C-c C-s to run org-schedule. The calendar will pop up and then the date can be selected for schedule.

Once the date is selected, org-mode inserts a scheduling timestamp after the TODO item.

When the file is saved and hitting C-c a a for org-agenda, A display of this week’s scheduled items are displayed.

Press “l” (lowercase of L) to turn on log display. This displays the all finished tasks and their completion times.

Exporting and Publishing

Org-Mode can be exported to other file formats.

To export an Org file to a formatted ASCII text file, use: M-x org-export-as-ascii

To export as HTML, use: M-x org-export-as-html

To export as Markdown, use one of these commands:

  • C-c C-e m m (org-md-export-to-markdown) Export to a text file with Markdown syntax (myfile.org -> myfile.md)

  • C-c C-e m M (org-md-export-as-markdown) Export to a temporary buffer. Does not create a file

  • C-c C-e m o Export as a text file with Markdown syntax, then open it.

This document is written using org mode and converted into markdown through the above commands.

Easy Templates

Easy template is used to define block of code.

Easy Templates

Structure of code blocks

0