Coder Social home page Coder Social logo

orgmode-cheatsheet's Introduction

S’organiser avec Orgmode

Headlines - Outline mode

Chaque titre commence par un ou plusieurs *

Visibility of the headline hierarchy:

  • Local visibility cycling with <TAB>
  • Global visibility cycling with S-<TAB>

Increase or decrease level with S-M RIGHT or S-M LEFT

Move up/down within a level with S-M UP or S-M DOWN

Move a headline under another top level headline: Cursor on the headline and then C-c C-w

Concept: ToDo keywords

Default is TODO and DONE

Cycling through them with S RIGHT or S LEFT

More keywords can be defined with a line #+SEQ_TODO:

  • Items left of | are TODO items
  • Items right of | are DONE items

Activate line with C-c C-c

Get a menu of all keywords: C-c C-t

Concept: Schedule, deadline and agenda view

Scheduling is done with C-c C-s

Deadlines are defined with C-c C-d

Switch to agenda view with C-a a

Follow mode with S-F

Move forward with f or backward with b

Concept: Repeating tasks

Some tasks occur frequently, so we should schedule them frequently.

To schedule a repeating task you need to modify the timestamp: eg. < 2018-07-04 Mer [REPEAT]>

The term [REPEAT] can be:

  • +1w Next occurence in one week. (w=week, d=day, m=month, y=year).
  • ++1w Next occurence on the same day of week, but definitely in the future.
  • .+4w Next occurence 4 weeks after the task is marked as done.

Concept: Checklists

Checklists provide a simple “checkoff” list.

Checklists start with

  • [ ] Text for checkitem

New checklist lines can be added with C-c C-x M (the capital letter ‘M’ not the Meta key)

You can see the completion of the checklist with [/] or [%] on the headline

Checkboxes are toggled with C-c C-c

Concept: Tags

Tags can be added to headlines and are often used as a way to mark GTD contexts.

Tags can be predefined with a line #+TAGS: PHONE(o)...... at the beginning of the file.

To assign a tag to a headline use C-c C-q

If you have predefined tags with keys assigned, you see a menu, but you still can enter free tags by pressing <TAB>. Finish definition with Enter.

Concept: Agenda mode (adavanced)

In the agenda view:

KeyFunction
AAgenda for the current week or day
S-lTimeline for current buffer
tList of all TODO entries
S-tEntries with a special TODO keyword
mMatch tags / properties / TODO keywords
S-mLike before, but only TODO entries
sSearch for keywords

Concept: Customized agenda views

From the agenda view:

S-c Edit custom agenda views

Concept: Drawers, Logging and quick notes

Drawers start with a line :DRAWERNAME: and end with the next line that says :END:. Everything between those lines is hidden when the drawer is closed. Open/close a drawer with <TAB>.

Reserved drawer names are e.g. :LOGBOOK: or :PROPERTIES:

Customize org-log-into-drawer to LOGBOOK.

Take quick notes with C-c C-z Finish and store the note with C-c C-c

Concept: Archiving

Finished tasks clutter up your org files, so it’s time to move them out the way.

Define a global archive file with #+ARCHIVE: filename.org::

Archive an entry with C-c C-x C-a Archive a subtree with C-c C-x C-s

Search all subtrees under a headline and see which one can be archived with this keys C-u C-c C-x C-s

Concept: Automatic logging of status change

Goal: Get a logbook entry whenever a TODO keyword changes

#+SEQ_TODO: TODO(t@/!)

  • t hotkey assigned to that todo keyword
  • @ log a timestamp and a note when this is entered
  • ! log a timestamp when you leave that keyword

Goal: Log a CLOSED timestamp when something is done

Customize variable org-log-done

Goal: Log a note with a timestamp everytime something is reschedule

Customize variable org-log-reschedule

Concept: Splitting your system up to several files

Goal: Instead of one file for all we want to have one for private things and one for work.

Procedure:

  • Customize org-agenda-files so that both files are used to generate the agenda views.
  • Customize refile function (fine tuning)
    • org-refile-targets
    • org-refile-use-outline-path
    • org-refile-allow-creating-parent-nodes
  • Move entries with C-c C-w
  • Copy enries with C-c M-w

Concept: The first capture template(s)

Goal: Capturing tasks, ideas and whatever

Procedure:

  • Define a capture key in your .emacs file:
(global-set-key (kbd "<f6>") 'org-capture)
  • Write template files (eg. tpl-todo.txt)
  • Press your capture f6 key and S-c to configure
    • Hotkey for capture
    • Destination
    • Format
    • Based on what template file or text
  • Start capturing

Concept: The :PROPERTIES: drawer

The :PROPERTIES: drawer stores task specific settings and used defined attributes.

Important: the :PROPERTIES: drawer must immediately follow the headline.

Goal: You don’t want to create a log enry every time a task is done.

Recipe: Define a :LOGGING: property with value nil.

Matching properties in agenda views is possible too.

Concept: Archiving to different files

Goal: You want to archive your read books in an extra file and not inside the global archive.

Recipe: Define an :ARCHIVE: property with the target name eg. :ARCHIVE: track-books::* Read books Definition is done on the top hierarchy level and then inherited to its children.

Concept: Ordered tasks

Goal: Tasks must be completed one after the other.

Recipe: Define the :ORDERED: property with value t.

Toggle the :ORDERED: property with C-c C-x o

Customizing variables:

'(org-enforce-todo-dependencies t)
'(org-track-ordered-property-with-tag t)

More customization:

org-agenda-dim-blocked-tasks
org-enforce-todo-checkbox-dependencies

Concept: Timers

Goal: Start a countdown timer.

Recipe: Start it with C-c C-x :

Goal: Start a relative timer

Recipe:

CommandShortcut
Start timerC-c C-x 0
Start with offsetC-u C-c C-x 0
Insert simple time stampC-c C-x .
Insert description time stampC-c C-x -
Pause timer=C-c C-x ,=
Start again=C-c C-x ,=
Stop with=C-u C-c C-x ,=

Concept: Clocking (aka time tracking)

Goal: Measure how long you need for a task

  • Clock in C-c C-x C-i
  • Clock out C-c C-x C-o

Customization

'(org-clock-into-drawer "CLOCKING")

More key combinations:

Commandshortcut
Restart a clockC-c C-x C-x
Restart with menuC-u C-c C-x C-x
Jump to clocked taskC-c C-x C-j
Cancel clockC-c C-x C-q
Show timesC-c C-x C-d

Concept: Column view

Goal: Show your org file in columns

Recipe: Define columns like that #+COLUMNS:%7TODO(To Do)%58ITEM(Task)....

Column view can be set locally with the :COLUMNS: property drawer.

Show column view C-c C-x C-c

Leave view q

Concept: Effort estimates

Goal: Estimate the effort that you task will need.

Recipe: Effort estimates are stored in a property :Effort:

Easy setup: Define #+PROPERTY:Effort_ALL and then possible values. Add this to column view with %8Effort(Effort){:}. The {:} means sum up times.

Show column view with C-c C-x C-c

Increase effort: S-rarrow Decrease effort: S-larrow

Leave view q

Concept: Linking (internal)

Goal: Link to other items in the actual file.

Recipe: A link looks like that

[[target]]

You can also use a description like

[[target][description]]

Targets:

  • A headline
  • A place in the document with a #+NAME: target line
  • An item with a :CUSTOM_ID: property

Special:

  • Radio targets that look like this <<<target>>> create a link on the fly

Key combinations:

commandshortcut
Edit links withC-c C-l
Follow link withC-c C-o
Return to previous positionC-c &

Concept: Linking (external))

Goal: Link to other items somewhere in the world.

Recipe: A link looks like that:

[[target]]

You can also use a description like

[[target][description]]

Targets: protocol:location

Special: Linking to items with an ID property ID is an UUID that you create with M-x org-id-get-create

Shortcut:

The purpose of this code is that it creates ID properties for every headline (if there isn’t one already) when you save your OrgMode file.

;; Credit: http://stackoverflow.com/questions/13340616/assign-ids-to-every-entry-in-org-mode

(defun my/org-add-ids-to-headlines-in-file ()
  "Add ID properties to all headlines in the current file which
do not already have one."
  (interactive)
  (org-map-entries 'org-id-get-create))

(add-hook 'org-mode-hook
          (lambda ()
            (add-hook 'before-save-hook 'my/org-add-ids-to-headlines-in-file nil 'local)))

This function is bound to the F5 key. Whenever you press F5 then it takes the ID and copies it to the killring (aka Clipboard). If the headline has no ID property it creates one. In that way, you can easily create links to IDs because copying the ID is just one keystroke.

;; Credit: https://koenig-haunstetten.de/2016/07/09/code-snippet-for-orgmode-e05s02/

(defun my/copy-id-to-clipboard() "Copy the ID property value to killring,
if no ID is there then create a new unique ID. 
This function works only in org-mode buffers.

The purpose of this function is to easily construct id:-links to 
org-mode items. If its assigned to a key it saves you marking the
text and copying to the killring."
       (interactive)
       (when (eq major-mode 'org-mode) ; do this only in org-mode buffers
	 (setq mytmpid (funcall 'org-id-get-create))
	 (kill-new mytmpid)
	 (message "Copied %s to killring (clipboard)" mytmpid)
       ))

(global-set-key (kbd "") 'my/copy-id-to-clipboard)

Customizing: org-id-locations-file stores in what file orgmode should look for IDs.

Credits

Most of these notes comes from Rainer König video serie on OrgMode tutorial.

orgmode-cheatsheet's People

Contributors

darkbuffalo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.