zkk / Getting yourself organized with Org-mode - Rainer Konig



Welcome

Introduction

Things can be divided in categories :

All 3 categories must bu present in your life, specially the third one.

It is also important have some rest in a daily routine.

At the end, whatever idea you might have, will be processed in simple steps as follows:

The course book

Files “shipped” with the course are :

The basics of Org-mode

Installation of Org-mode

Check if new version of Org is available by typing : M-x list-packages under org package.

Doom Emacs

Headlines & outline mode

Important key combinations :

In order to move a headline under another parent headline it is possible to increase one level then move up or down to that parent headline and then decrease one level.

Otherwise it is possible to use the following key combination:

This method is called =Refiling blocks=.

ToDo keywords

It is possible to create a file and put inside all TODO stuffs with descriptions. List of tasks must be headlines.

Every single TODO is a sort of idea or task that can be assigned a keyword as follows :

There are also 2 keywords for tasks that are marked as completed, that are :

It is needed the following configurations line at the beginning of any of the TODO file :

#+SEQ_TODO: NEXT(n) TODO(t) WAITING(w) SOMEDAY(s) PROJ(p) | DONE(d) CANCELLED(c)

And, in order to activate these KEYWORDS, key combination C+c C+c must to be pressed when on this configuration line.

To set a keyword to a particular task it is possible either by:

Schedule, deadlines & agenda views

Navigate through agenda by pressing S-ArrowKeys.

It is also possible to add hour like 9:00 or adding pm/am.

In order to see scheduled or deadlines date in an Agenda View the TODO file we are writing, after saving it, must be put in a particular variable org-agenda-file-to-front by pressing key combination C+c [ is needed in order to put current file in Agenda. In a similar way, C+c ] to remove the file.

To show files that are in the org-agenda-file-to-front select M+x org-edit-agenda-file-list or, in Doom Emacs, SPC : org-edit-agenda-file-list.

Now it is possible to show Agenda by the command M-x org-agenda (in Doom Emacs is SPC o A) and press a.

Here are some key combinations in Agenda View :

Repeating tasks

We have repeating taks when the action is rescheduled afeter we set it as DONE. Repeating tasks can be set by adding some digits in Scheduled or Deadline stamp of our ToDo list. What we have to add is the repeating period.

We have period like :

Also we can reschedule task with :

Let’s say we have a repeated task to complete every week on Suturday. The next scheduled is for next Saturday January 7th (now is Jan 4th). And le’s say I cannot do my task for a couple of week and set =DONE= only next Sun 15th. We can have different date for next automatic scheduled task as follows:

Repeating tasks show in Agenda every occurancy (i.e. a daily task is shown in Agenda every day also in the future days). This is not good for the readibility of the Ageda itself. To make a repeating item to show only the next occurancy we have to properly seto the org-agenda-show-future-repeats variable. To customize variables it is a good idea to start from M-x custom (Doom Emacs SPC : custom) and search the variable.

Checklists

Simply put a double sqare brackets [ ] whith a space inside on a list under a headline, like the example at the end of this paragraph. Note that checklists can also have more levels for sub checkboxes. Also note the possibility to have automatic feedback of numer or percentage of checklist dompleted.

Here useful to know :

Example:

- Checklist [1/3] [33%]
  - [-] item 1
    - [ ] sub item 1a
    - [X] sub item 1b
  - [ ] item 2
  - [X] item 3

Advanced topics

Tags

TAGS can be pre-defined and/or free tags to assign on single task or headlines in a Task/ToDo org file. Usually TAGS are in capital letters and (always) between :. Example of configuration line:

#+TAGS PHONE(o) COMPUTER(c) SHOPPING(s) URGENT(u)

In order to refresh configuration you must press C-c C-c while on the configuration line:

To assign configured tags place the cursor to the target line and press C-c C-q to open up a small window to choose tags from.

Lower level headlines inherit TAGS from upper level headlines.

Advanced Agenda Views

When calling Agenda View (i.e. M-x org-agenda or SPC o A in Doom Emacs) by default are displayed 10 days. This settings can be configured in the variable org-agenda-span.

It is also possibile to pre append number of days do display for the next Agenda View to be called as follows:

Usefull Agenda Views :

Customized agenda views

Use the variable org-agenda-custom-commands.

Drawers, logging and quick notes

Drawer are lines delimited by the beginning of the drawer (i.e. :DRAWERNAME:) and the end of the drawer that is always :END:.

So it is usefull to put inside a drawer called :LOGBOOK: all notes related to a particular task. In order to start we have to create the drawer just under the headline task or below the scheduled time like this:

* Headline
  :LOGBOOK:
  :END:

And then accordingly change the variable org-log-into-drawer.

Now, when the cursor is on a particular task:

Notes will be stored in LOGBOOK like a blog.

Archiving

Archive Tasks can be done inside the same file by setting :ARCHIVE: tag to the headline/task. This can be done also by key combination C+c C+x a that toggle the :ARCHIVE: tag.

This so called internal archiving leave only one line of archived task and this will not be visible anymore in agenda view.

There is also the possibility to archive task and all subtrees in an external file in order to keep more clean the tasks file. There are several way in order to get this done put at the beginning of the file the archived items destination by a configuration line that loo like the following:

#+ARCHIVE: %s~archive~::`

And press the key combination C+c C+x C+s.

It is also possible to set this configuration globally by changing with the same string the variable org-archive-location.

In order to set a per-headline configuration the same strings must be write just below the headline inside the :PROPERTIES: drawer.

After archiving to external file Emacs modify a buffer for that archive file but without saving it. It is a good habit after the archive action to save all buffer the key combination C+c s.

Sometimes it is useful to search in completed tasks to find some notes or whatever in some items completed in the past. This can be done following the below steps:

Making things more smooth

Automatic logging of status changes

In order to automatic logging in the :LOGBOOK: section when a task change its state and, maybe, taking some notes to explain why, we have to put some symbols in the configuration line where we set up TAGS.

After every single tag, inside brackets and after the letter we choose for representing the tag, we can put some configuration like this (example for TODO tag):

TODO(t@/!)

Explanation:

If you want disable automatic logging for selected headline or task, just add inside the :PROPERTIES: drawer the following :

:PROPERTIES:
:LOGGING: nil
:END:

There are some variable about automatic logging:

These variable set the behavior of automatic logging in case of DONE and RESCHEDULE. Both variable can have these 3 values:

At the beginning of a task file we can set this variable at #+STARTUP line followed by, for example, lognotedone or logreschedule.

Splitting your system into several files

Splitting TODO items in 2 files, private.org and work.org, could be a good idea. In any case we must learn to refile items that means to copy/cut and paste headlines and all their subtrees:

The first capture template

Capture template is a sort of pre-defined form to fill in order to insert more quickly a new task in your task/todo file (key combination in Doom Emacs is SPC X).

Following the course we define a custom templete for a TODO entry and save it in a file called tpl-todo.txt as follow :

* TODO %^{Nuovo TODO, titolo} :NEW:
  Obiettivo: %?
  :LOGBOOK:
  - Added: %U
  :END:

Now we have to modify accordingly our config.el file:

(after! org
	(setq org-capture-templates
		'(
			("t" "TODO entry" entry
			 (file+headline "~/Org/task.org" "Capture")
			 (file "~/Org/tpl-todo.txt")))))

Note that above settings completely override Doom Emacs pre-defined templates.

And now, everytime we SPC X the menu of our custom templates appear. After inserting easly our new ToDo item and a brief goal description, our task/todo file is updated.

Just another tip: when a new capture is done, Emacs store the last captured in bookmarks that, form me, is not good. To avoid we need to toggle off the relative variable org-capture-bookmark.

In case we have multiple todo/task files, could be usefull practice store captured items in a separate file (i.e. capture.org). After a while (weekly?) we can review captured items and =refile= headline to the proper task file.

More capture template

Just a couple of more template examples.

Journal entry

To be added after the previous TODO entry template :

(after! org
	(setq org-capture-templates
		'(
			("t" "TODO entry" entry
				(file+headline "~/Org/capture.org" "Capture")
				(file "~/Org/tpl-todo.txt"))
			("j" "Journal entry" entry
				 (file+olp+datetree "~/Org/journal.org")
				 (file "~/Org/tpl-journal.txt")))))

Here it is the config file tpl-journal.txt:

* %u - %^{activity}
  %?

Book template

Here it is qhat I have inserted as third template:

("b" "Book to read" entry
 (file+headline "~/Org/task.org" "Books")
 (file "~/Org/tpl-book.txt")
	:empty-lines-after 1)

With this configuration file tpl-book.txt:

* SOMEDAY Book: %^{Titolo} - %^{Autore}
  :PROPERTIES:
  :Titolo: %<1
  :Autore: %<2
  :END:
  - Note iniziali: %?
  :LOGBOOK:
  - Added: %U
  :END:

Workflows and time tracking

Ordered tasks

Tasks can be forced to be completed in a certain order or sequence by the properties :ORDERED: that has to be put in the :PROPERTIES: section of the upper headline level.

The value must be set to t (true).

Key combination to toogle the :ORDERED: property is C-c C-x o.

Here are some usefull variable:

Timers

Clocking

It is possible to track time spent over certain tasks:

Orgmode store all these informations in frawer that can be configured by the variable org-clock-into-drawer that, of course, can be customized.

To start again last stopped clocking task press C-c C-x C-x.

And finally, to show last clocking tasks in order to restart clocking one of them, prefix C-u to the above key combination so that will result as: C-u C-c C-x C-x. orgmode will show a menu where to choose the task you want to clock.

To summarize all time spent in the various tasks press C-c C-x C-d and the status bar will show the total time of the task file while on the write of the various headlines involved in clocking will be showed the total amount spent.

To get rid of the time spend just press C-c C-c, it doesn’t matter where the cursor is placed.

Column view

Effort estimates

Linking, attachments and more

Linking (internal)

Linking (external)

Attachments

Priorities

Tables

Exporting and publishing

Exporting

Advanced exporting

Publishing

More advanced topics

Dynamic blocks

Tracking habits

Bulk agenda actions

Google calendar import

Working with source code blocks

Goal settings and tracking

Presenting my system