Welcome
Introduction
Things can be divided in categories :
- Have to do, no matter to escape and you have to do NOW;
- Should do, usually cannot escape but you can PLAN;
- Whant to do, often for pleasure.
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:
- Write it down (capture);
- Decide if it’s actionable or just information;
- If it’s actionable and too big, break it down to smaller tasks;
- Decide the very next action to move towards Done;
- Do your actions;
- Frequently review your system.
The course book
Files “shipped” with the course are :
- coursefiles.zip lots of examples files that self extract in orgmode-coursefiles folder;
- main.pdf and main.epub over 100 pages of course book in pdf and epub format.
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
doom upgrade, upgrade the system if available;doom sync, synchronize private config with Doom;doom upgrade, update Doom to the latest release & all installed packages;doom doctor, diagnosyic common issues with system and config;doom env, dump a snapshot of shell environment to a file that Doom will load at startup (this, among other things, allows Emacs to inherit variable $PATH);doom build, recompile all installed packages if Emacs was up/downgraded.
Headlines & outline mode
Important key combinations :
M-Left, increase headline level;M-Right, decrease headline level;M-Up, move headlines up inside the same headline level;M-Down, move headlines down inside the same headline level;C+c C+p, jump to previous visible headline;C+c C+n, jump to next visible headline.
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:
C+c C+w, then enter the target new parent headline.
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 :
- NEXT, defines a next action, it means that you can do the task in any moment from now on without the need of anything else;
- TODO, it is an action that needs to be done but needs some requirements before proceeding;
- WAITING, defines an action done but waiting for something in order to proceeds;
- SOMEDAY, it is an idea that is not yet decided if it is actionable;
- PROJ, stands for PROJECT, an it is used to group some action toghether.
There are also 2 keywords for tasks that are marked as completed, that are :
- DONE, marks successfully completed tasks;
- CANCELLED, tasks not completed or even not started.
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:
C+c C+t, and then press the letter on the left of the keyword (i.e. n for NEXT);- Loop from differend keywords by pressing
S-LeftorS-Rightarrow key.
Schedule, deadlines & agenda views
- SCHEDULED task is set by
C+c C+s; - DEADLINE for a task by
C+c C+d.
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 :
[/]to navigate back and forth by weeks;- When in a line of a particular scheduled or deadline task press TAB to open the file that belongs to in a split window and then
C-x 0to close the window; - Press
qto quit Agenda View; - Press
xto quit Agenda View, save and kill buffers related to agenda files.
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 :
d, for days;w, for weeks;m, for months;y, for years.
Also we can reschedule task with :
+, means plus a period after the last scheduled/deadline, also if happended in the past;++, means adding a period but in day in the future, not in the past;.+, means adding a period from the day the task is set to DONE.
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:
+1w, next scheduled on Jan 14th (so in the past).++1w, next scheduled on Jan 21st (so on the next Saturday, next week)..+1w, next scheduled on Jan 22nd (so exactly +1 week after we set the task done).
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 :
S-M-RET, create next checklist item;C-c C-c, on an item toggle tick/untick;M-Right/Left, decrease/increase item level;[ ], means undone item/task and (if any) all sub elements;[-], means task partially done that could have sub item commpleted;[X], means item done and (if any) all sub items.
Example:
- Checklist [1/3] [33%]
- [-] item 1
- [ ] sub item 1a
- [X] sub item 1b
- [ ] item 2
- [X] item 3Advanced 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:
C+u #where # stands for the number of days to display, then callM-x org-agenda(SPC o Awith Doom Emacs).
Usefull Agenda Views :
n, Agenda and all TODOs;T, Entry special TODO keyword like for examples NEXT|TODO;m, Mach a TAGS/PROP/QUERY where is allowed to enter logical expressions like PHONE+TODO=“NEXT”;s, Search for keyword where is possibile to use regulare expressions;<, Buffer, subtree/region restriction usefull to search items in archived files.
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:
C-c C-z, to open logbook note;C-c C-c, to save the note.
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:
- Open the archive file;
- Switch to Agenda View;
- Select the
<option, that means to restrict the Agenda to the buffer from which Agenda was called; - Press
sto search for something, you will be prompt the results of the query; - Go with the cursor on the searched item and press
RETorTAB, the archived file buffer display with curson on the searched item.
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:
@, means put timestamp and take a note;!, means put only timestamp./, before the slash means when TODO tag is set, after means when TODO tag is unset.
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:
- org-log-done;
- org-log-reschedule.
These variable set the behavior of automatic logging in case of DONE and RESCHEDULE. Both variable can have these 3 values:
- nil, means no logging at all;
- time, logs only timestamp;
- note, logs timestamp and note.
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:
C-c C-w, cut and paste;C-c M-w, copy and paste.
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:
- org-enforce-todo-dependencies, if set to true (means
t) it is not possibile to set as DONE an upper headline level if the dependencies are not set DONE as well; - org-track-ordered-property-with-tags, if set to true (i.e.
t) an :ORDERED: tag (the tag name can be configured) will be set to the headline involved; - org-agenda-dim-blocked-task, setting this variable as
t(true), make items that cannot be done because of previous tasks not yet completed, shows in Agenda in dim gray color; - org-enforce-todo-checkbox-dependencies, setting this variable to the value
t(true) avoid make a headline as DONE if its checklist is not fully completed.
Timers
Clocking
It is possible to track time spent over certain tasks:
C-c C-x TAB, to start clocking on the task you have the cursor on;C-c C-x C-o, to finish clocking where =o= stands for Check-(O)ut;C-c C-x C-q, to cancel clocking;C-c C-x C-j, move the point over the task that is currently clocking.
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.