This is the example org-mode file used for the Denver Emacs org-mode introduction talk. Everything in this talk should work without any custom settings or installation with a reasonably recent Emacs version.
Let’s start with a headline, this is kind of like Markdown’s #
character:
Text can be put into the headline. You can create another headline at the same level with another * character
Nesting headlines is as easy as adding another start
You can really go as deep as you want. This is the general building block for org-mode navigation.
Next, let’s talk about some markup
- underscores let you underline things
- stars add emphasis
- slashes are italics
pluses are strikethroughequal signs are verbatim text
tildes can also be used
You can generate lists with the -
character (seen above), or create numbered
ones:
- Number one thing
- Number two thing
- Number three
You can hide the contents of a headline by putting the point (cursor) or it and
hitting TAB
.
You can also toggle hiding and showing of all headlines with SHIFT-TAB
.
Auto expanding tables are one of the coolest features of org-mode, because
tables in Markdown just plain suck. In order to create a new table, you can
start typing it manually, or press C-c |
, which will prompt for the table’s
dimensions.
First Name | Last Name | Years using Emacs |
---|---|---|
Lee | Hinman | 5 |
Mike | Hunsinger | 2 |
Daniel | Glauser | 4 |
Really-long-first-name-guy | long-last-name-pers | 1 |
In an org-mode file, you can press C-c l
to store a pointer to wherever you
are in the file. Then, with (or without) text highlighted hit C-C C-l
to make
it into a link.
The example file for Magit
If you don’t want to store a pointer (ie, link to a website or something), you
can just hit C-c C-l
and type or paste the link. To manually create a link, do
something like:
The Denver Emacs Meetup Group
Writequit site
Google’s web site
(ignore the *_SRC blocks for now, we’ll get there)
[[http://google.com/][Google]]
You can link to files, images, websites, emails, irc, and all kinds of things.
* Various things you can add in headers
One of the most common uses for org-mode is a sort of “task list” or TODO list. Org-mode supports this by allowing markers in the headline for the state of a task. Let’s look at an example:
** TODO This is a task that needs doing
** TODO Another todo task
- [ ] sub task one
- [X] sub task two
- [ ] sub task three
** Learn about org-mode
*** TODO learn todos
*** TODO learn other stuff
You can toggle each task in a list with the C-c C-c
keyboard shortcut.
** DONE I’ve already finished this one
You can change the status of a task by hitting C-c t
in the body of a task
anywhere, which will prompt for the state to put it in.
You can create as many of these as you’d like, for example (from my own config, use what works best for you, configuring them is a little out of scope right here) here’s what I use:
*** TODO something that needs doing *** DONE something that’s already done *** INPROGRESS something I’m currently doing *** WAITING waiting for someone else before doing anything *** NEEDSREVIEW there’s a PR for this, it needs someone to look at it *** HOLD this is in permanent hold until further notice *** CANCELLED I don’t need this any more *** SOMEDAY I’d like to do this someday in the waaaaay off future
A lot of people just use “TODO” and “DONE” though.
** Adding tags and priorities
You can add tags by putting them surrounded in “:” in the headline. Additionally, priorities
*** Headline with a tag :org:
*** Another tagged headline :turing:denver:
*** Headline with multiple tags :org:emacs:
Tags are just another way of organizing things.
*** [#A] Important task *** [#B] Medium task *** [#C] Non-important task
Again you can configure these, or just use the 3 built in ones. *** TODO [1/3] Task with sub headlines **** TODO Finish thing **** TODO Finish that other thing **** DONE Done with a thing
*** [33%] Task with sub headlines (percent cookie) **** TODO Finish thing **** TODO Finish that other thing **** DONE Done with a thing
* The TODO-planner payoff
So TODOs are all well and good, but what is a really neat feature is when you can easily capture new TODOs and display them easily.In order to do this, let’s configure a couple of Emacs options in your emacs init:
(require 'org)
;; Setup C-c c to capture new TODOs
(global-set-key (kbd "C-c c") 'org-capture)
;; Setup a key bind for the agenda
(global-set-key (kbd "C-c a") 'org-agenda)
;; Set up agenda to know about our file, you can use a list of files or
;; directories here
(setq org-agenda-files '("~/todo.org"))
;; A new template
(setq org-capture-templates
'(("t" "Todo" entry (file "~/todo.org")
"* TODO %?\n%U\n")))
Now, hit C-c c
to bring up the capture template list, then t
to capture a
new TODO item.
Once you’ve captured a few TODOs, you can try out the agenda by hitting C-c a
,
which will prompt for what agenda you’d like to see, for now hit t
to see the
TODO list agenda.
* Exporting an org-mode buffer
Org has a lot of export options, they are all contained behind a C-c C-e
export backend, exporting to HTML, markdown, plain text, pdf, etc.
* Show off other features of org-mode if we have more time Maybe not in excruciating detail, but we can show off the power and cover it in more detail at a later time:
- refiling (
org-refile
) - source code blocks
- org-babel
- clocking in/out
- table formulas
- custom agenda views
- capturing notes (not just TODOs)
- publishing projects remotely via TRAMP
(defun my/function ()
"docstring"
(interactive)
(progn
(+ 1 1)
(message "Hi")))
echo $data > /tmp/foo
for i in `cat /tmp/foo`; do
echo $i
done
1 |
2 |
3 |
4 |
echo "hi"
hi
# do some things
echo "stuff"
echo "more stuff"
echo <<hi>>
To enter and edit a block of text, use C-c C-'
Note: a complete list of these features including keyboard shortcuts, links, and descriptions is available on https://github.com/novoid/github-orgmode-tests
This page demonstrates Org-mode features that are (or are not) supported by github which is using an (old) version of org-ruby.
Last GitHub feature render check and last table update: <2020-10-15 Thu>
Feature | status |
Text formatting | :WORKS: |
Text formatting within other syntax elements | :WORKS: |
Lists | :PARTLY: |
Headings with TODO items | :FAILS: |
Drawers | :FAILS: |
blocks (docu) | :PARTLY: |
EXAMPLE block | :WORKS: |
QUOTE block | :WORKS: |
VERSE block | :FAILS: |
SRC block | :WORKS: |
python | :WORKS: |
shell | :WORKS: |
ruby | :WORKS: |
ditaa | :WORKS: |
session with shell and R | :WORKS: |
QUOTE block | :WORKS: |
HTML block | :FAILS: |
LATEX block (docu) | :FAILS: |
NOTES block | :FAILS: |
comments (docu) | :WORKS: |
Noexport tag of heading | :WORKS:noexport: |
links (docu) | :PARTLY: |
states; TODO items (docu) | :PARTLY: |
tags (docu) | :FAILS: |
tables simple (docu) | :PARTLY: |
tables complex (docu, tutorial) | :PARTLY: |
column view (docu) | :FAILS: |
dates & time (docu) | :WORKS: |
clocking time (docu) | :PARTLY: |
* Featuretest
- bold
- italic
- underline
strike throughcode
commands
- http://orgmode.org
small example
Within links:
This is an example of some syntax highlighting within links
and such
.
Table:
Example |
---|
http://orgmode.org |
Org mode |
This is an example of some syntax links and such . |
Lists:
- Example
- This is an example of some syntax
highlightingwithinlinks
andsuch
.
- This is an example of some syntax
Headings:
- MISSING:
- Checkbox rendering/alignment
- Reusing same enumerate bullet symbols (dash, numbers, …)
simple list:
- Org mode
- Lists
- [ ] unchecked checkbox
- [X] checked checkbox
- [-] undecided checkbox (
C-u C-u C-c C-c
)
enumerate:
- Emacs
- Org-mode
- Lists
mixed with checkboxes:
- Clean out garage
- [ ] get stuff out
- [ ] be careful with that axe, Eugene
- [X] get rid of old stuff
- using eBay?
- try to use rubbish as birthday presents for family
- [ ] repaint garage
- [X] put stuff back in
- [ ] get stuff out
- MISSING
- display of TODO keywords
- be careful with that axe, Eugene
- using eBay?
- try to use rubbish as birthday presents for family
- MISSING:
- rendering of drawers
6.6 blocks (docu)
- including babel (docu)
An example in an EXAMPLE block. Second line within this block. This *is* an /example/ of _some_ syntax +highlighting+ within =links= and ~such~.
Will be wrapped:
An example in an QUOTE block. Second line within this block.
This is an example of some syntax
highlightingwithinlinks
andsuch
.
- MISSING:
- rendering of the block
def my_test(myvar: str = 'foo bar'):
"""
This is an example function.
@type myvar: str = 'foo bar': number
@param myvar: str = 'foo bar': FIXXME
"""
mynewvar: str = myvar + ' additional content'
return mynewvar
print("Hello " + my_text('Europe!'))
(message (concat "Hello" "Europe!")) ;; inline comment
- some examples are taken from Worg: Introduction to Babel
echo "Hello Europe!"
FOO="foo bar"
echo "A test with ${FOO}"
pwd
require 'date'
"This file was last evaluated on #{Date.today}"
+---------+
| cBLU |
| |
| +----+
| |cPNK|
| | |
+----+----+
cd ~/archive/events_memories && du -sc * |grep -v total
Using result set “directories” from above as “dirs” in R below:
pie(dirs[,1], labels = dirs[,2])
Will be wrapped:
An example in an QUOTE block. Second line within this block.
This is an example of some syntax
highlightingwithinlinks
andsuch
.
- MISSING:
- rendering of the block
This is a paragraph with a link within.
6.6.7 LATEX block (docu)
- MISSING:
- rendering of the block
- some special characters
- Greek characters
- Working outside of block: α β φ
- not working: \LaTeX{}
$\varphi$
- MISSING:
- rendering of the block
Notes blocks are not standard Org mode. However, org-reveal
is using
it for handout notes so I would like to include it here.
6.7 comments (docu)
Comment lines:
space hash space:
space space hash space:
Comment block:
6.8 links (docu)
- MISSING:
<<link>>
- following
id:
links - custom links
- without your Emacs config, those links are impossible to follow
- rendering somehow would be fine
- footnotes
todo: target
# <<link>>
- id:myexampleid
- ~/.zshrc.local
- http://orgmode.org
- custom links: contact:John Smith
- footnotes (docu)
- plain :great content here
- with own label mylabel
- reference myotherlabel 2
myotherlabel This is a footnote from reference above. 2 This is a footnote with a simple number as label.
Footnotes aren’t working
great content here
#myexampleid
anchor, doesn’t work as of 2021-04-11
great content here
#myexamplecustomid
anchor, doesn’t work as of 2021-04-11
great content here
6.9 states; TODO items (docu)
- MISSING:
- todo keywords
- dependencies from within drawers
great content here
great content here
great content here
great content here
great content here
great content here
6.9.2 priorities (docu)
great content here
great content here
great content here
6.9.3 breaking down in subtasks (docu)
great content here
great content here
great content here
great content here
great content here
6.10 tags (docu)
- MISSING:
- rendering tags
great content here
great content here
6.11 tables simple (docu)
- MISSING:
- number alignment
Heading1 | head2 |
---|---|
entry | 42 |
foo | 21.7 |
end | 99.99 |
great content here
- MISSING:
- Tables are concatenated unfortunately and alignment fails.
US-Dollar | EUR | ||
1 | 0.76481836 | ||
When | What | USD | EUR |
---|---|---|---|
2012-02-03 | Taxi Graz-Airport | 18.00 | |
2012-02-03 | Taxi Seattle Airport | 25.00 | 19.12 |
2012-02-13 | Taxi | 7.00 | 5.35 |
2012-02-14 | Taxi | 8.00 | 6.12 |
2012-02-17 | Taxi to Airport SeaTac | 35.00 | 26.77 |
2012-02-22 | Taxi Airport-Graz | 16.00 | |
91.36 |
great content here
6.13 column view (docu)
- MISSING:
- no support for those things
great content here
great content here
great content here
6.14 dates & time (docu)
C-c .
insert active <2012-04-23 Mon> (withC-u
: <2012-04-23 Mon 19:14>)C-c !
insert inactive [2012-04-23 Mon] (withC-u
: [2012-04-23 Mon 19:14])
great content here
6.15 clocking time (docu)
- MISSING:
- drawer information
great content here
Clock summary at [2012-11-19 Mon 11:17]
Headline | Time |
---|---|
Total time | 27:16 |
great content here
great content here
great content here
This sub-hierarchy is here to test specific stuff.
You can ignore everything starting from here.
great content here
great content here
great content here
head1 | head2 | head3 |
---|---|---|
text | 42 | ----- |
[email protected] | 23 | :-) |
65 |
great content here
- direct URL: http://tagstore.org
- indirect URL
- direct email: [email protected]
- indirect email
- file link should link to README.org
- file + heading link
should link to README.org#links – used to work but was broken sometime after
2020-11-01
great content here
verse:
quote:
This is an example. Second line. Very long line with many characters showing the wordwrap feature or the not existing word wrap feature
only colon:
This is an example. Second line. Very long line with many characters showing the wordwrap feature or the not existing word wrap feature
non-specific source:
This is an example. Second line. Very long line with many characters showing the wordwrap feature or the not existing word wrap feature
python source:
if VALUE and dummy < 42:
execute_something("Dummy text", 23)
great content here
- me_low
- 2_8
*.org_archive
*.org\_archive
- *.org\_archive
great content here
Das hier ist eine Erklärung von dem Ganzen:
Und in der Org-mode-Datei wird das dann so angewendet:
great content here
- This is a subset(!) of Org-mode basics to demonstrate the main features (sometimes probably more) of this wonderful tool
- Find the newest version of this document on https://github.com/novoid/org-mode-workshop
key | description |
---|---|
M | Meta (often: Alt) |
C | Ctrl |
S | Shift |
TAB | Tabulator |
RET | Return, Enter, CRLF |
UP | arrow: up |
DOWN | arrow: down |
LEFT | arrow: left |
RIGHT | arrow: right |
SPC | Space |
great content here
- http://orgmode.org/org.html#Activation
- http://orgmode.org/worg/org-configs/org-customization-guide.html
Activation of Org-mode (external Tutorial):
(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
(define-key global-map "\C-ca" 'org-agenda) ;; by convention: "C-c a" opens agenda
(define-key global-map "\C-cc" 'org-capture) ;; by convention: "C-c c" captures stuff
(define-key global-map "\C-cl" 'org-store-link) ;; by convention: "C-c l" stores a link to this heading
(setq org-log-done t) ;; if you want to log DONE-states to the :LOGBOOK:-drawer
- Org-mode minor mode (structure editing and lists)
orgstruct-mode
(docu)
great content here
- http://orgmode.org/org.html is up to date
C-h i
(while being in an Org-mode file) gives you a local version :-)
great content here
For using Org-mode from a local git repository: add following to your configuration:
(add-to-list 'Info-additional-directory-list "~/.emacs.d/<YOURDIRECTORY>/org-mode/doc/")
OR: install Org-mode documentation to your system with:
cd $ORGMODEDIRECTORY && sudo make install-info
great content here
8.3 text formatting syntax (docu)
- bold
- italic
- underline
strike throughcode
commands
- http://orgmode.org
small example
- not (yet) working and edge cases:
- *combination*
- /combination/
- *combination*
- _combination_
*combination*
C:\a\very\old\DOS\path
- http://orgmode.org
- orgmode-Homepage
- *orgmode* /Homepage/
great content here
8.4 outlining (docu)
- headlines start with asterisks
- levels
- visibility
TAB
visibility cyclingS-TAB
change buffer visibilityC-c C-r
reveal context- per-file visibility
#+STARTUP: overview
and so on: (docu) C-u C-u TAB
restore startup visibility
- motion
C-c C-n
next headingC-c C-p
previous headingC-c C-u
one level upC-c C-j
jump (goto)C-c C-f
forward same levelC-c C-b
backward same levelM-x org-goto
nifty inerface for searching within an Org-mode buffer
- create basic elements
C-RET
new heading below
- move elements
M-UP/DOWN
move up/down with subitemsM-LEFT
promoteM-RIGHT
demoteM-S-LEFT/RIGHT
promote/demote with subitems
C-c C-c
toggle/modify things (docu)- checkbox: activate/deactivate, heading: tags, tables: re-calculate, jump footnote and back, update tables, update TODO-count, …
C-c C-x b
open sub-tree in separate buffer (org-tree-to-indirect-buffer)
great content here
- [ ] DEMO: create headings
great content here
- [ ] DEMO: visibility cycling
- [ ] DEMO: move headings
This is a quite boring text just to show some body content.
great content here
This is a quite boring text just to show some body content.
great content here
This is a quite boring text just to show some body content.
great content here
This is a quite boring text just to show some body content.
great content here
This is a quite boring text just to show some body content.
great content here
great content here
great content here
- whole Org-mode files
- selective headlines using :crypt:
org-decrypt-entry
great content here
8.4.4 time stamps when taking notes (docu, info:org#Timers)
C-c C-x .
start timerC-c C-x -
insert list item with timeM-<RET>
insert heading with timeC-c C-x ,
toggle timer pauseC-u C-c C-x ,
stop timer- also handy:
C-c C-x ;
set countdown
great content here
8.5 sparse trees (docu)
- Filtering
C-c /
Filter in sparse treesC-c / r
Filter using Regular Expressions
- Moving in results
M-g n
goto next matchM-g o
goto previous match
- docu: property search
C-c a L
time sorted view of buffer
great content here
8.6 lists (docu)
M-RET
new list itemM-S-RET
create checkboxM-LEFT/RIGHT/UP/DOWN
move itemC-c -
cycle item type OR turn into list item
great content here
simple list:
- Emacs
- Org-mode
- Lists
enumerate:
- Emacs
- Org-mode
- Lists
check lists:
great content here
- [ ] DEMO: create simple lists and move items around
great content here
M-S-RET
new item with checkboxC-c C-*
checkboxes become TODOsC-c C-C
toggle checkboxes between[X]
and[ ]
C-u C-u C-c C-C
toggle checkboxes between[ ]
and[-]
- Clean out garage
- [ ] get stuff out
- [ ] be careful with that axe, Eugene
- [ ] get rid of old stuff
- using eBay?
- try to use rubbish as birthday presents for family
- [ ] repaint garage
- [ ] put stuff back in
- [ ] get stuff out
great content here
great content here
great content here
- be careful with that axe, Eugene
great content here
- using eBay?
- try to use rubbish as birthday presents for family
great content here
great content here
great content here
8.6.5 Taking notes during a meeting or similar (docu)
C-c C-x .
(re)start a timerC-c C-x -
orM-<RET>
insert description list item with the current relative timeC-c C-x ,
pause/continueC-u C-c C-x ,
stop timer
Bonus feature:
C-c C-x ;
count down timer
great content here
8.7 drawers, properties, columns (docu)
- meta-data on headings
- standard drawers :PROPERTIES: and :LOGBOOK:
- ends with :END:
- FIXXME
C-c C-z
timed LOGBOOK entry:ID: label
define ID in PROPERTIES- hint: the property CATEGORY gets inherited and displayed on the agenda:
great content here
great content here
8.8 blocks (docu)
- encapsulating content with begin…end structure
<s + TAB
easy templates (docu)
Some example from a text file.
- more of it in the Babel section later on
- differences between non-source-code blocks (docu):
type | indendation | blank lines | line breaks | Org syntax | notes |
---|---|---|---|---|---|
example | preserved | preserved | preserved | ignored | like SRC block without a language |
verse | preserved | preserved | preserved | recognized | |
quote | preserved | preserved | not preserved | recognized | for quoting text |
center | not preserved | preserved | not preserved | recognized |
great content here
This is a test. Demonstration of long lines within a non-source-code block like this or that or something else which is quite good. Space upfront [[id:foobar]] *bold* /italic/
This is a test.
Demonstration of long lines within a non-source-code block like this or that or something else which is quite good.
Space upfront
id:foobar bold italic
This is a test.
Demonstration of long lines within a non-source-code block like this or that or something else which is quite good.
Space upfront
id:foobar bold italic
great content here
8.9 links (docu)
[[link]] [[link][description]]
target:
# <<link>>
- id:myexampleid
- ~/.zshrc.local
- http://orgmode.org
- custom links: contact:John Smith
C-c l
store link (also in many other buffer types: docu)C-c C-l
inserting link (or edit existing link)C-u C-c C-l
file link (shortcut)C-c C-o
open linkC-c C-x C-n
goto next linkC-c C-x C-p
goto previous link- “radio targets” are auto-links created by target like
<<<target name>>>
- all occurrences of “target name” will be links
C-c C-x C-v
toggle show inline imagesC-c %
push position into ringC-c &
goto last saved position in ring- footnotes (docu)
- plain :great content here
- with own label mylabel
- reference myotherlabel 2
C-c C-c
jump between footnote and referenceC-c C-x f
footnote action command (see docu)
myotherlabel This is a footnote from reference above. 2 This is a footnote with a simple number as label.
- many external link types see docu
great content here
foo bar
great content here
8.10 states; TODO items (docu)
C-c C-t
rotate TODO stateC-c / t
sparse tree with TODOsC-c a t
global TODO list in agendaC-S-RET
new TODO heading- per-file keywords
#+TODO: TODO(t) FEEDBACK(f) | DONE(d!) CANCELED(c!@)
!
timestamp@
add note
great content here
- simple, ordered method with PROPERTIES drawer:
:ORDERED: t
C-c C-x o
toggle ORDERED property- see only tasks that are not depending on other open tasks
- see only things that can be done now
- http://orgmode.org/worg/org-contrib/org-depend.html
- to define workflows (see demo below)
- task dependencies with org-depend (docu)
:BLOCKER: an-heading-id another-heading-id
define blocking task:TRIGGER: chain-siblings(NEXT)
define trigger for setting NEXT:TRIGGER: my-heading-id(NEXT)
define trigger for specific heading to set to NEXT
great content here
great content here
great content here
great content here
great content here
great content here
After setting this task to DONE, enjoying new clothes get to state NEXT and looking out for next errands to TODO.
great content here
great content here
I can not finish this task as long as I did not enjoy my new clothes.
great content here
- org-edna: bit more complex syntax compared to org-depend but also more powerful
- same general approach using
:BLOCKER:
and:TRIGGER:
properties - task dependencies with org-edna:
:BLOCKER: ids("an-heading-id" "another-heading-id")
define blocking task:BLOCKER: ids("id:an-heading-id" "another-heading-id")
same example but navigable id:TRIGGER: ids("my-heading-id") todo!(NEXT) scheduled!("++3d")
define trigger for specific heading to set to NEXT and schedule 3 days later
great content here
great content here
After setting this task to DONE, enjoying new clothes get to state NEXT and looking out for next errands to TODO.
great content here
great content here
I can not finish this task as long as I did not enjoy my new clothes.
great content here
8.10.3 logging state changes (docu)
!
in todo state definitionorg-log-into-drawer
for setting default behavior
great content here
8.10.4 habits (docu)
- enable habits module by customizing the variable
org-modules
- TODO items with property STYLE is set to the value
habit
:
:STYLE: habit
** TODO Shave SCHEDULED: <2009-10-17 Sat .+2d/4d> - State "DONE" from "TODO" [2009-10-15 Thu] - State "DONE" from "TODO" [2009-10-12 Mon] - State "DONE" from "TODO" [2009-10-10 Sat] - State "DONE" from "TODO" [2009-10-04 Sun] - State "DONE" from "TODO" [2009-10-02 Fri] - State "DONE" from "TODO" [2009-09-29 Tue] - State "DONE" from "TODO" [2009-09-25 Fri] - State "DONE" from "TODO" [2009-09-19 Sat] - State "DONE" from "TODO" [2009-09-16 Wed] - State "DONE" from "TODO" [2009-09-12 Sat] :PROPERTIES: :STYLE: habit :LAST_REPEAT: [2009-10-19 Mon 00:36] :END:
great content here
8.10.5 priorities (docu)
C-c ,
set prioritiesS-UP/DOWN
change priority- [A], [B], [C]
- no priority is ordered like [B]
great content here
great content here
8.10.6 breaking down in subtasks (docu)
- for TODO-headings: stat cookies
[/]
or[%]
(will be[1/3]
or[33%]
) - also possible:
- for checkboxes
- recursive
- mark entry to DONE if all children are DONE
great content here
great content here
great content here
great content here
great content here
C-c C-x C-v
org-toggle-inline-images
great content here
8.12 tags (docu)
- inherited tags
- per-file definition of tags:
#+TAGS: { @work(w) @home(h) } online(o) kids(k)
- per-file tags for all entries:
#+FILETAGS: :this:that:foo:
C-c C-q
set tagsC-c C-c
set tags if cursor is on a headingC-c / m
search for tags in sparse treeC-c a m
global list of tag matchingC-c a M
same but check only TODO items- syntax (docu)
+boss+urgent
ANDboss|urgent
OR+boss+urgent-project
combination of tagswork+TODO="WAITING"|home+TODO="WAITING"
Waiting tasks both at work and at home
great content here
great content here
8.12.2 Tag groups (docu)
- searching for a group tag return matches of all member tags as well
- example:
(setq org-tag-alist '((:startgroup . nil)
("@read" . nil)
(:grouptags . nil)
("@read_book" . nil)
("@read_ebook" . nil)
(:endgroup . nil)))
- searching for “@read” also returns “@read_book” and “@read_ebook”
great content here
8.13 tables simple (docu)
C-c C-c
update tableTAB
move next fieldRET
next rowM-LEFT/RIGHT/UP/DOWN
moving rows/columnsC-c -
insert vertical bar belowC-c |
convert region into table OR: insert new tableC-c ^
sort lines (in region)- [ ] DEMO: create table
great content here
-
C-c |
move region into table (see docu)- TABs, CSV, …
-
C-c +
sum current column (or marked rectangle) -
=$1+$2
value = sum of 1st and 2nd column -
:=vsum(@I..@II)
field = sum between 1st and 2nd hline -
C-u C-u C-c C-c
recompute table with iterations (docu) -
#+TBLFM: $3 = $1 + $2
table formula
- ~#+TBLFM: $1 = -1 + 1
- @2$1 = 1~ incremental numbers
org-table-import
import data from CSV fileorg-table-export
export data to CSV file
US-Dollar | EUR | ||
1 | 0.76481836 | ||
When | What | USD | EUR |
---|---|---|---|
2012-02-03 | Taxi Graz-Airport | 18.00 | |
2012-02-03 | Taxi Seattle Airport | 25.00 | 19.12 |
2012-02-13 | Taxi | 7.00 | 5.35 |
2012-02-14 | Taxi | 8.00 | 6.12 |
2012-02-17 | Taxi to Airport SeaTac | 35.00 | 26.77 |
2012-02-22 | Taxi Airport-Graz | 16.00 | |
91.36 |
C-c C-c
update valuesC-c }
visualize rows/columnsC-c '
edit formula in separate bufferC-c C-r
switch between internal references (@3$2) and standard references (B3)S-<up>/<down>/<left>/<right>
shift reference at point
- debugging formulas
- many, many, many more table features in the documentation!
- http://orgmode.org/worg/org-tutorials/index.html#sec-3-2
- http://orgmode.org/worg/org-faq.html#Tables
- http://orgmode.org/worg/org-hacks.html#sec-1-4
- calculations using time, date, hex, GPS, …
great content here
Here is another example working with tables and referencing other tables. I did this example twice: first in a column (vertical) based layout and then the very same example in a row (horizontal) based layout:
great content here
Income May 2012 | Income June 2012 | |
---|---|---|
Joe | 12 | 10 |
Alice | 22 | 24 |
Bob | 16 | 17 |
sum | 50 | 51 |
June 2012 (from above) | plus 20 percent | June 2013 | Difference | |
---|---|---|---|---|
Joe | 10 | 12.0 | 11 | -1.0 |
Alice | 24 | 28.8 | 31 | 2.2 |
Bob | 17 | 20.4 | 21 | 0.6 |
sum | 51 | 1.8 |
- all formulas explained in detail:
-
@>$5=vsum(@I..@II)
- value:
1.8
- last row (
@>
) of column five ($5
) is the sum of column five between first and second horizontal line (@I..@II
)
- value:
-
@>$3=string("")
- no value (empty)
- overwrite the last row (
@>
) of column three ($3
) with an empty string - otherwise it would get 1.2 times the value of corresponding column of table Income2012v as well - I chose not to want this sum in this column
-
$1='(identity remote(Income2012v, @@#$1))
- values:
Joe
untilsum
- copy content of the first column of table “Income2012v”
(Lisp formula
'(identity remote(Income2012v, @@#$1))
) to the first column in this table ($1
) - the “identity” statement prevents calc from interpreting the content
- this is because I am too lazy to enter all names once again :-)
- see also Org-hacks for field formulas
- values:
-
$2='(identity remote(Income2012v, @@#$3))
- values:
10; 24; 17; 51
- copy the content of the second column of table “Income2012v” to the second column in this table
- you could skip this column and calculate the values of the next
columns with direct references to
remote(Income2012v, @@#$3)
as well. However, it is more easy to compare visually if the values from 2012 are shown here as well (usability/readability) - note: by convention, only the values after the first horizontal line are taken
- values:
-
$3=1.2 * remote(Income2012v, @@#$3);%.1f
- values:
12.0; 28.8; 20.4; 61.2
- column three (
$3
) is 120 percent of the values of the third column of table “Income2012v” with one decimal place (;%.1f
) - note: 61.2 (1.2 times 51) is overwritten by formula
@>$3
from above
- values:
-
$5=$4-$3;%.1f
- values:
-1.0; 2.2; 0.6
- column five (
$5
) is the difference between column four to column three with one decimal place
- values:
-
Here is another example: how to sum up the numbers of the first column so far:
Numbers | Sum of numbers so far |
---|---|
1 | 1 |
5 | 6 |
10 | 16 |
50 | 66 |
200 | 266 |
1000 | 1266 |
The formular can be simplified even more by using a column formula:
#+TBLFM: $2=vsum(@2$1..$-1)
provides the same result as above.
great content here
Joe | Alice | Bob | sum | |
Income May 2012 | 12 | 22 | 16 | 50 |
Income June 2012 | 10 | 24 | 17 | 51 |
Joe | Alice | Bob | sum | |
Income June 2012 | 10 | 24 | 17 | 51 |
plus 20 percent | 12.0 | 28.8 | 20.4 | 60.0 |
June 2013 | 11 | 31 | 21 | |
Difference | -1.0 | 2.2 | 0.6 | 1.8 |
- all formulas explained in detail:
-
@>$>=vsum(@5$2..@5$4)
- value:
1.8
- last column in last row (
@>$>
) is the vector-sum (vsum
) of column two to four of fifth row (@5$2..@5$4
)
- value:
-
@1$2..@1$4='(identity remote(Income2012h, @1$$#))
- values:
Joe | Alice | Bob | sum
- column two to four of first row (
@1$2..@1$4
) are copied from the corresponding fields of the first row (@1$$#
) of table “Income2012h” - see also Org-hacks for field formulas
- values:
-
@2='(identity remote(Income2012h, @3$$#))
- values:
2012 Income June | 10 | 24 | 17 | 51
- the second row (
@2
) is copied from the corresponding fields of the first row (@1$$#
) of table “Income2012h” - my guess: “2012” is moved to the beginning of the field most probably because it is interpreted as numeric value and not as string
- values:
-
@3$2..@3$4=1.2 * remote(Income2012h, @3$$#);%.1f
- values:
12.0 | 28.8 | 20.4 | 60.0
- the columns two to four of the third row (
@3$2..@3$4
) is 120 percent of the corresponding values of the third row (@3$$#
) of the table “Income2012h” with one decimal place (;%.1f
)
- values:
-
@5$2..@5$4=@4-@3;%.1f
- values:
-1.0 | 2.2 | 0.6
- the column two to four of the fifth row (
@5$2..@5$4
) is the difference of the values in the corresponding values of the fourth row and the third row (@4-@3
) with one decimal place (;%.1f
)
- values:
-
great content here
8.15 column view (docu)
C-c C-x C-c
activate column viewe
edit valuen/p
next/previous valueq
quit column viewa
edit allowed valuesC-c C-x p
set property
great content here
great content here
great content here
8.16 capture, refile, archive (docu)
C-c c
captureC-c C-w
refileC-c C-x C-a
archiveC-u C-u C-c c
goto last capture#+ARCHIVE: %s_done::
per-file archiveC-c C-x a
toggle ARCHIVE tagC-u C-c C-x a
check direct children for archiving
;; ######################################################
;; templates for capturing C-c c
;; http://orgmode.org/org.html#Capture-templates
(setq org-capture-templates
'(
("s" "shorts-todo" entry (file+headline "~/share/all/org-mode/misc.org" "shorts")
"* NEXT %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1)
("e" "Event" entry (file+headline "~/share/all/org-mode/misc.org" "Events")
"* %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1)
("i" "IST Templates")
("is" "IST shorts" entry (file+headline "~/share/all/org-mode/IST.org" "shorts")
"* NEXT %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1)
("ie" "IST event" entry (file+headline "~/share/all/org-mode/IST.org" "Events")
"* %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1)
("ii" "IST isst" entry (file+headline "~/share/all/org-mode/IST.org" "Events")
"* %? IST isst: \n:PROPERTIES:\n:CREATED: %U\n:END:\n\n- [[contact:Ingo Pill][Ingo Pill]]\n- [[contact:Thomas Quartisch][Thomas Quartisch]]\n\n" :empty-lines 1)
("b" "Besorgung" entry (file+headline "~/share/all/org-mode/hardware.org" "Besorgungen")
"* TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1)
("C" "Clipboard" entry (file+headline "~/share/all/org-mode/misc.org" "shorts")
"* TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n%x\n\n" :empty-lines 1)
("c" "capture to inbox, refile later" entry (file "~/share/all/org-mode/inbox.org")
"\n* %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1)
("m" "movie" entry (file+headline "~/share/all/org-mode/movies.org" "inbox")
"* TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1)
("x" "xlog")
("xh" "xlog hometrainer" table-line (id "xlog-hometrainer") "| %T | | | |")
("xk" "Keyboard Akkus leer" table-line (id "3407c9b7-1b41-443b-9254-32c4af3a54e8") "| %T |")
)
)
great content here
8.17 attachments (docu)
C-c C-a
org-attach (menu)i
inherits
set directorya
attach: move file to task directoryc/m/l
attach: copy/move/link file
- much more
great content here
8.18 dates & time (docu)
C-c .
insert active <2012-04-23 Mon> (withC-u
: <2012-04-23 Mon 19:14>)C-c !
insert inactive [2012-04-23 Mon] (withC-u
: [2012-04-23 Mon 19:14])S-RIGHT/LEFT/UP/DOWN
interactively change timestampC-c <
insert todayC-c C-o
open agenda for current timestampC-c C-d
insert DEADLINEC-c C-s
insert SCHEDULEDC-u C-c C-d
removing DEADLINEC-u C-c C-s
removing SCHEDULEDC-c / d
sparse tree with deadlinesDEADLINE <YYYY-MM-DD DoW +2d>
defining repeated events/tasks.+2w
repetition interval starting with last DONE timestamp++3m
never show multiple times even if not DONE.+2d/4d
show up on agenda not earlier as 2 days until 4 days+1w -2d
repeat weekly but show not earlier as two days beforeC-c C-x c
clone (recurring) event with time-shift (org-clone-subtree-with-time-shift
)- good idea: create recurring event and clone it with time-shift
- this way, canceling single events or moving single events is possible
13:00-15:15
or13:00+2:15
time range<2013-11-15 Fri>-<2013-11-17 Sun>
date rangeC-c C-y
return time range between datesUP/DOWN
on time stamp start/end -> toggle active/inactive
Note: please do not use time-stamps prior to UNIX epoch which is 1970-01-01. Some systems do handle those time-stamps fine, others produce errors.
great content here
8.18.1 advanced date/time with sexp (docu)
To do a thing every x days between two dates, put:
%%(and (diary-cyclic x M1 D1 Y1) (diary-block M1 D1 Y1 M2 D2 Y2)) thing
22:00-23:00 The nerd meeting on every 2nd Thursday of the month
<%%(diary-float t 4 2)>
great content here
8.19 agenda (docu)
C-c [
add buffer to agendaC-c ]
remove buffer from agendaC-c a
show agenda command menuC-c a a
invoke agenda viewC-c C-x <
lock agenda to subtreeC-c C-x >
release agenda restriction lock
when being in agenda mode:
q
quit agendaj
jump to date.
goto todayf/b
forward/backv
choose view menud/w
day/week viewv d/w/m
view for day/week/monthr
refreshRET
goto itemSPC
show item<
toggle filter to fileF
toggle follow modeo
delete other window/
filter by tagE
toggle entry textR
toggle clock reportt
change TODO state:
orT
set tagsS-UP/DOWN
set priority,
set priorityS-LEFT/RIGHT
change timestamp day>
change timestamp to todaye
set effortm
marku
unmarkB
bulk actionS
scatter marked TODOs over the next N days
- clocking
I
startO
stopX
cancelJ
jump to running clock entry
- attachments to TODO entries
C-c C-a
attachment menuC-c C-a s
set attachment folderC-c C-a i
inherit attachment folderC-c C-a o
open attachment
- learn how to create your own agenda views:
great content here
8.20 clocking time (docu)
C-c C-x C-i
start clock on itemC-c C-x C-o/x
stop or cancel clock on itemC-c C-x C-d
display total subtree timesC-c C-c
remove displayed timesC-c C-x C-r
insert/update table with report- please do read Irreal: Org Clocking and Idle Time for handling idle time for clocking
great content here
Clock summary at [2012-11-19 Mon 11:17]
Headline | Time |
---|---|
Total time | 27:16 |
great content here
great content here
great content here
8.21 dynamic blocks with ELISP (docu)
- execute ELISP functions in special blocks (see docu)
C-c C-x C-u
update blockC-u C-c C-x C-u
update buffer blocks
great content here
8.22 source code (docu)
- python “Hello World”
C-c '
edit in native mode<s + TAB
easy templates (docu)
def foo(argument):
print ("Hello World")
foo(42)
great content here
8.23 babel (docu)
- http://orgmode.org/org.html#Languages
- 2012-04-23: 35(!) languages
C-c C-c
execute codeC-c C-v j
insert header argument (menu)- many shortcuts for all kind of things
- debugging
- output control
- navigation
- session handling
C-c C-v b
execute babel in bufferC-c C-v s
execute babel in subtree
great content here
8.23.1 babel simple (doc)
- some examples are taken from Worg: Introduction to Babel
great content here
pwd
great content here
require 'date'
"This file was last evaluated on #{Date.today}"
great content here
return 42 + 7
great content here
+---------+
| cBLU |
| |
| +----+
| |cPNK|
| | |
+----+----+
great content here
great content here
cd ~/archive/events_memories && du -sc * |grep -v total
Using result set “directories” from above as “dirs” in R below:
pie(dirs[,1], labels = dirs[,2])
great content here
- Examples in this session is inspired by a great DevOps-demo video by Howard Abrams (Demo material)
Executing shell commands:
echo "Executed by `whoami` on `hostname` in `pwd`"
Doing something as root:
apt-get update
Switching to a remote host:
ssh [email protected] 'echo "Executed by `whoami` on `hostname` in `pwd`"'
great content here
Note: results
, dir
, and session
parameters for babel are placed
in the PROPERTIES
drawer above.
Do stuff remote:
echo "Executed by `whoami` on `hostname` in `pwd`"
date
See interactive shell in buffer: 2015-11-02-ssh-testsession
great content here
time = epoch
import datetime
strtime = str(time)
datetimestamp = datetime.datetime.utcfromtimestamp(int(strtime[:10]))
print(datetimestamp.strftime('[%Y-%m-%d %a %H:%M:%S]'))
UNIX epoch | time-stamp |
---|---|
1262675465119 | [2010-01-05 Tue 07:11] |
1234567890 | [2009-02-13 Fri 23:31] |
1000000000 | [2001-09-09 Sun 01:46] |
great content here
8.24 LaTeX (docu)
C-c '
open block native bufferC-c C-x C-l
preview LaTeX fragmentsC-c C-c
quit previewC-c C-x \
toggle preview TeX characters as UTF-8
Greek characters α β φ \LaTeX{}
M-x org-cdlatex-mode
CDLaTeX minor mode- from http://staff.science.uva.nl/~dominik/Tools/cdlatex/
- similar to AucTeX
C-c {
insert environmentequ TAB
expands equation`
insert math symbols (menu)
great content here
8.25 export formats (docu)
C-c C-e
export menuC-c ;
toggle COMMENT keyword on entry- tag: “noexport”
- ASCII/Latin-1/UTF-8 export
- HTML
- LaTeX
- DocBook
- OpenDocument Text
- TaskJuggler
- Freemind
- XOXO
- iCalendar
- Pandoc
- …
- [ ] DEMO: export this as PDF (plain)
- [ ] DEMO: export this as PDF (beamer)
great content here
8.25.1 Export options (docu)
- per file:
C-c C-e t
(org-insert-export-options-template)
- per heading:
- see properties drawer above
- EXPORT_OPTIONS: see docu
great content here
8.26 MobileOrg (docu)
- great iOS app
- no iOS on my side
- does not seem to be maintained any more :-(
- Android app
- sync via Dropbox, ssh, scp, WEBDAV, gpg encryption, …
;;; http://orgmode.org/org.html#MobileOrg
;;; directory where to store MobileOrg-files
(setq org-mobile-directory "~/share/all/org-mode/mobile-org/")
(setq org-directory "~/share/all/org-mode")
(setq org-mobile-inbox-for-pull "~/share/all/org-mode/inbox.org")
(setq org-mobile-force-id-on-agenda-items nil)
'(org-mobile-files (quote ("~/share/all/org-mode/contacts.org" "~/data/share/all/org-mode/hardware.org" )))
- http://www.orgzly.com/ (since approx. 2015-01)
- promising new app
great content here
- sections above are only a small fraction of the feature-set of Org-mode!
- read the manual or the mailinglist to get inspired :-)
great content here
- per configuration
- per file
- per heading
great content here
Things I did not include yet but are worth mentioning:
- [ ] org-protocol
great content here