Skip to content

Latest commit

 

History

History
746 lines (640 loc) · 36.6 KB

README.org

File metadata and controls

746 lines (640 loc) · 36.6 KB

Org layer

img/org.png

Table of Contents

Description

This layer enables org mode for Spacemacs.

Features:

BibTeX

For more extensive support of references through BibTeX files, have a look at the BibTeX layer.

Important Note

Since version 0.104, spacemacs uses the org version from the org ELPA repository instead of the one shipped with emacs. Then, any org related code should not be loaded before dotspacemacs/user-config, otherwise both versions will be loaded and will conflict.

Because of autoloading, calling to org functions will trigger the loading up of the org shipped with emacs which will induce conflicts. One way to avoid conflict is to wrap your org config code in a with-eval-after-load block like this:

(with-eval-after-load 'org
  ;; here goes your Org config :)
  ;; ....
  )

Please also note that everything described here only applies if you install this layer instead of manually loading org as separate emacs package.

If this is not done you will encounter a lot of unbind key exceptions while working with org. More details can be found here.

Install

Layer

To use this configuration layer: in the main Spacemacs configuration file (~/.spacemacs), to the existing dotspacemacs-configuration-layers list add the org entry.

Github support

To install Github related extensions like ox-gfm to export to Github flavored markdown set the variable org-enable-github-support to t.

(setq-default dotspacemacs-configuration-layers '(
  (org :variables org-enable-github-support t)))

Twitter Bootstrap support

To enable the export to Twitter Bootstrap-formatted HTML - set the variable org-enable-bootstrap-support to t. This would install the ox-twbs extension.

(setq-default dotspacemacs-configuration-layers '(
  (org :variables
       org-enable-bootstrap-support t)))

Gnuplot support

Org-mode supports the plotting of data within tables through Gnuplot as demonstrated here.

Unfortunately, this is not terribly well supported on Windows, at this stage. To disable the configuration of gnuplot support - add the gnuplot package to your dotspacemacs-excluded-packages variable.

Reveal.js support

To enable the export of org files as a reveal.js presentation - set the variable org-enable-reveal-js-support to t. This would install the org-reveal Emacs extension.

(setq-default dotspacemacs-configuration-layers
 '((org :variables org-enable-reveal-js-support t)))

Then the extension needs to be pointed to the reveal.js itself. So download reveal.js and point org-reveal-root to the path, as it described in the manual.

Alternatively, add the following line to each .org file you want to process:

#+REVEAL_ROOT: http://cdn.jsdelivr.net/reveal.js/3.0.0/

Org-journal support

org-journal is a simple journal management system that:

  • Keeps a separate journal file for each day inside a directory
  • New daily file would always migrate entries with chosen TODO states
  • Has journal encryption functionality
  • Easily integrates with org-agenda and Emacs calendar, iCalendar, allows scheduling
  • Easily integrates with org-capture

To install org-journal - set the variable org-enable-org-journal-support to t.

(setq-default dotspacemacs-configuration-layers '(
  (org :variables
       org-enable-org-journal-support t)))

By default, journal files are stored in ~/Documents/journal/. To override this - set org-journal-dir variable in the dotspacemacs/user-config:

(setq org-journal-dir "~/org/journal/")

To change the journal file name format - alter org-journal-file-format:

(setq org-journal-file-format "%Y-%m-%d")

Warning: setting org-journal-file-format to include a file extension like %Y-%m-%d.org would break the calendar search functionality.

By default, journal files are started with a first level heading (*) followed by the date in the form set by locale. To format journal files differently:

  • alter org-journal-date-prefix and org-journal-date-format. For example, to have new journal files created with this header:
    #+TITLE: Tuesday, September 06 2016
        
  • define the following in dotspacemacs/user-config:
    (setq org-journal-date-prefix "#+TITLE: ")
    (setq org-journal-date-format "%A, %B %d %Y")
        

The default entry is a second level heading (=** =) followed by a timestamp. If you start your journal files with a Title as shown above you may want to adjust entries to start at the first level heading and you may want to change or omit the timestamp.

(setq org-journal-time-prefix "* ")
(setq org-journal-time-format "")

Any of the org-journal settings can be configured in dotspacemacs/user-config or defined alongside the layer itself.

For example:

(setq-default dotspacemacs-configuration-layers '(
  (org :variables
      org-enable-org-journal-support t
      org-journal-dir "~/org/journal/"
      org-journal-file-format "%Y-%m-%d"
      org-journal-date-prefix "#+TITLE: "
      org-journal-date-format "%A, %B %d %Y"
      org-journal-time-prefix "* "
      org-journal-time-format "")
)

Hugo support

To install the Org exporter ox-hugo that generates Hugo -compatible Markdown plus TOML/YAML front-matter, set the variable org-enable-hugo-support to t.

(setq-default dotspacemacs-configuration-layers '(
  (org :variables
       org-enable-hugo-support t)))

Trello support

To install Trello support set the variable org-enable-trello-support to t.

(setq-default dotspacemacs-configuration-layers '(
  (org :variables
       org-enable-trello-support t)))

Different bullets

You can tweak the bullets displayed in the org buffer in the function dotspacemacs/user-config of your dotfile by setting the variable org-bullets-bullet-list. By default the list is set to ("◉" "○" "✸" "✿").

(setq org-bullets-bullet-list '("" "" "" ""))

You can disable the fancy bullets entirely by adding org-bullets to dotspacemacs-excluded-packages.

(dotspacemacs-excluded-packages '(org-bullets))

Project support

Set the layer variable org-projectile-file to the filename where you want to store project-specific TODOs. If this is an absolute path, all todos will be stored in the same file (organized by project), whereas if it is just a single filename, todos will be stored in each project root.

(setq-default dotspacemacs-configuration-layers
  '((org :variables org-projectile-file "TODOs.org")))

The TODO files are not added to the agenda automatically. You can do this with the following snippet.

(with-eval-after-load 'org-agenda
  (require 'org-projectile)
  (mapcar '(lambda (file)
                 (when (file-exists-p file)
                   (push file org-agenda-files)))
          (org-projectile-todo-files)))

Org-brain support

For Emacs 25 or later, support for org-brain is included. See the org-brain package documentation for more information.

Mode line support

To temporarily enable mode line display of org clock, press SPC t m c.

To permanently enable mode line display of org clock, add this snippet to your dotspacemacs/user-config function:

(setq spaceline-org-clock-p t)

Key bindings

Starting org-mode

Key bindingDescription
SPC a o #org agenda list stuck projects
SPC a o /org occur in agenda files
SPC a o aorg agenda list
SPC a o corg capture
SPC a o eorg store agenda views
SPC a o f iorg feed goto inbox
SPC a o f uorg feed update all
SPC a o C corg cancel clock
SPC a o C gorg goto last clocked-in clock (go to specific recent clock with SPC u)
SPC a o C iorg clock in
SPC a o C Iorg clock in last
SPC a o C jorg jump to current clock
SPC a o C oorg clock out
SPC a o C rorg resolve clocks
SPC a o lorg store link
SPC a o morg tags view
SPC a o oorg agenda
SPC a o sorg search view
SPC a o torg todo list
SPC C corg-capture

Toggles

Key bindingDescription
SPC m T corg-toggle-checkbox
SPC m T eorg-toggle-pretty-entities
SPC m T iorg-toggle-inline-images
SPC m T lorg-toggle-link-display
SPC m T torg-show-todo-tree
SPC m T Torg-todo
SPC m T Vtoggle space-doc-mode a read-only view mode
SPC m T xorg-preview-latex-fragment

Org-mode

Key bindingDescription
SPC m <dotspacemacs-major-mode-leader-key>org-ctrl-c-ctrl-c
SPC m *org-ctrl-c-star
SPC m RETorg-ctrl-c-ret
SPC m -org-ctrl-c-minus
SPC m '​org-edit-special
SPC m aorg-agenda
SPC m Aorg-attach
SPC m corg-capture
SPC m C corg-clock-cancel
SPC m C dTemporarily show clock times for current file
SPC m C eorg-evaluate-time-range
SPC m C gorg-clock-goto
SPC m C iorg-clock-in
SPC m C Iorg-clock-in-last
SPC m C jJump to the current clock
SPC m C oorg-clock-out
SPC m C RInsert clock report
SPC m C rorg-resolve-clocks
SPC m d dorg-deadline
SPC m d sorg-schedule
SPC m d torg-time-stamp
SPC m d Torg-time-stamp-inactive
SPC m e eorg-export-dispatch
SPC m e msend current buffer as HTML email message
SPC m f iorg-feed-goto-inbox
SPC m f uorg-feed-update-all
SPC m lorg-open-at-point
SPC m Lorg-shiftright
SPC m Horg-shiftleft
SPC m Korg-shiftup
SPC m Jorg-shiftdown
SPC m C-S-lorg-shiftcontrolright
SPC m C-S-horg-shiftcontrolleft
SPC m C-S-jorg-shiftcontroldown
SPC m C-S-korg-shiftcontrolup
SPC s jspacemacs/jump-in-buffer (jump to a heading)

Org with evil-org-mode

Please see the evil-org documentation for additional instructions on customizing evil-org-mode.

Key bindingDescription
gj / gkNext/previous element (heading)
gh / glParent/child element (heading)
gHRoot heading
aeElement text object
arSubtree text object
M-j / M-kMove heading
M-h / M-lPromote or demote heading
M-J / M-KMove subtree
M-H / M-LPromote or demote subtree
>> / <<Promote or demote heading

If the layer variable org-want-todo-bindings is true, the following bindings are also available.

Key bindingsDescription
tCycle TODO state of current heading
TInsert new TODO heading
M-tInsert new TODO sub-heading

Tables

Key bindingDescription
SPC m t aAlign the table at point by aligning all vertical bars
SPC m t bBlank the current table field or active region
SPC m t cConvert from org-mode table to table.el and back
SPC m t d cDelete a column from the table
SPC m t d rDelete the current row or horizontal line from the table
SPC m t eReplace the table field value at the cursor by the result of a calculation
SPC m t EExport table to a file, with configurable format
SPC m t hGo to the previous field in the table
SPC m t HMove column to the left
SPC m t i cInsert a new column into the table
SPC m t i hInsert a horizontal-line below the current line into the table
SPC m t i HInsert a hline and move to the row below that line
SPC m t i rInsert a new row above the current line into the table
SPC m t IImport a file as a table
SPC m t jGo to the next row (same column) in the current table
SPC m t JMove table row down
SPC m t KMove table row up
SPC m t lGo to the next field in the current table, creating new lines as needed
SPC m t LMove column to the right
SPC m t nQuery for a size and insert a table skeleton
SPC m t NUse the table.el package to insert a new table
SPC m t pPlot the table using org-plot/gnuplot
SPC m t rRecalculate the current table line by applying all stored formulas
SPC m t sSort table lines according to the column at point
SPC m t t fToggle the formula debugger in tables
SPC m t t oToggle the display of Row/Column numbers in tables
SPC m t wWrap several fields in a column like a paragraph

Trees

Key bindingDescription
gj / gkNext/previous element (heading)
gh / glParent/child element (heading)
gHRoot heading
aeElement text object
arSubtree text object
M-j / M-kMove heading
M-h / M-lPromote or demote heading
M-J / M-KMove subtree
M-H / M-LPromote or demote subtree
>> / <<Promote or demote heading
TABorg-cycle
SPC m s aToggle archive tag for subtree
SPC m s AArchive subtree
SPC m s borg-tree-to-indirect-buffer
SPC m s lorg-demote-subtree
SPC m s horg-promote-subtree
SPC m s korg-move-subtree-up
SPC m s jorg-move-subtree-down
SPC m s norg-narrow-to-subtree
SPC m s Nwiden narrowed subtree
SPC m s rorg-refile
SPC m s sshow sparse tree
SPC m s Ssort trees

Element insertion

Key bindingDescription
SPC m i dorg-insert-drawer
SPC m i D sTake screenshot
SPC m i D yYank image url
SPC m i eorg-set-effort
SPC m i forg-insert-footnote
SPC m i Horg-insert-heading-after-current
SPC m i horg-insert-heading
SPC m i Kspacemacs/insert-keybinding-org
SPC m i lorg-insert-link
SPC m i norg-add-note
SPC m i porg-set-property
SPC m i sorg-insert-subheading
SPC m i torg-set-tags

Links

Key bindingDescription
SPC m x oorg-open-at-point

Babel / Source Blocks

Key bindingDescription
SPC m b .Enter Babel Transient State
SPC m b aorg-babel-sha1-hash
SPC m b borg-babel-execute-buffer
SPC m b corg-babel-check-src-block
SPC m b dorg-babel-demarcate-block
SPC m b eorg-babel-execute-maybe
SPC m b forg-babel-tangle-file
SPC m b gorg-babel-goto-named-src-block
SPC m b iorg-babel-lob-ingest
SPC m b Iorg-babel-view-src-block-info
SPC m b jorg-babel-insert-header-arg
SPC m b lorg-babel-load-in-session
SPC m b norg-babel-next-src-block
SPC m b oorg-babel-open-src-block-result
SPC m b porg-babel-previous-src-block
SPC m b rorg-babel-goto-named-result
SPC m b sorg-babel-execute-subtree
SPC m b torg-babel-tangle
SPC m b uorg-babel-goto-src-block-head
SPC m b vorg-babel-expand-src-block
SPC m b xorg-babel-do-key-sequence-in-edit-buffer
SPC m b zorg-babel-switch-to-session
SPC m b Zorg-babel-switch-to-session-with-code

Org Babel Transient State

Use SPC m b . to enter a transient state for quick source block navigation and execution. During that state, the following bindings are active:

Key bindingDescription
'edit source block
eexecute source block
gjump to named source block
jjump to next source block
kjump to previous source block
zrecenter buffer in window
qleave transient state

Emphasis

Key bindingDescription
SPC m x bmake region bold
SPC m x cmake region code
SPC m x imake region italic
SPC m x rclear region emphasis
SPC m x smake region strike-through
SPC m x umake region underline
SPC m x vmake region verbose

Navigating in calendar

Key bindingDescription
M-lOne day forward
M-hOne day backward
M-jOne week forward
M-kOne week backward
M-LOne month forward
M-HOne month backward
M-JOne year forward
M-KOne year backward

Capture buffers and src blocks

org-capture-mode and org-src-mode both support the confirm and abort conventions.

Key bindingDescription
SPC m <dotspacemacs-major-mode-leader-key>confirm in org-capture-mode
SPC m '​confirm in org-src-mode
SPC m cconfirm
SPC m aabort
SPC m kabort
SPC m rorg-capture-refile in org-capture-mode

Org agenda

Key bindings

The evilified org agenda supports the following bindings:

Key bindingDescription
M-SPC or s-M-SPCorg-agenda transient state
SPC m aorg-agenda
SPC m C corg-agenda-clock-cancel
SPC m C iorg-agenda-clock-in
SPC m C oorg-agenda-clock-out
SPC m C porg-pomodoro (if package is used)
SPC m d dorg-agenda-deadline
SPC m d sorg-agenda-schedule
SPC m i eorg-agenda-set-effort
SPC m i porg-agenda-set-property
SPC m i torg-agenda-set-tags
SPC m s rorg-agenda-refile
M-jnext item
M-kprevious item
M-hearlier view
M-llater view
grrefresh
gdtoggle grid
C-vchange view
RETorg-agenda-goto
M-RETorg-agenda-show-and-scroll-up

Org agenda transient state

Use M-SPC or s-M-SPC in an org agenda buffer to activate its transient state. The transient state aims to list the most useful org agenda commands and visually organize them by category. The commands associated with each binding are listed bellow.

Key bindingDescriptionCommand
Entry
htset statusorg-agenda-todo
hkkillorg-agenda-kill
hRrefileorg-agenda-refile
hAarchiveorg-agenda-archive-default
h:set tagsorg-agenda-set-tags
hpset priorityorg-agenda-priority
Visit entry
SPCin other windoworg-agenda-show-and-scroll-up
TAB& go to locationorg-agenda-goto
RET& del other windowsorg-agenda-switch-to
olinklink-hint-open-link
Filter
ftby tagorg-agenda-filter-by-tag
frrefine by tagorg-agenda-filter-by-tag-refine
fcby categoryorg-agenda-filter-by-category
fhby top headlineorg-agenda-filter-by-top-headline
fxby regexporg-agenda-filter-by-regexp
fddelete all filtersorg-agenda-filter-remove-all
Date
dsscheduleorg-agenda-schedule
dSun-scheduleorg-agenda-schedule
ddset deadlineorg-agenda-deadline
dDremove deadlineorg-agenda-deadline
dttimestamporg-agenda-date-prompt
+do laterorg-agenda-do-date-later
-do earlierorg-agenda-do-date-earlier
Toggle
tffolloworg-agenda-follow-mode
tllogorg-agenda-log-mode
taarchiveorg-agenda-archives-mode
trclock reportorg-agenda-clockreport-mode
tddiariesorg-agenda-toggle-diary
View
vddayorg-agenda-day-view
vwweekorg-agenda-week-view
vtfortnightorg-agenda-fortnight-view
vmmonthorg-agenda-month-view
vyyearorg-agenda-year-view
vnnext spanorg-agenda-later
vpprev spanorg-agenda-earlier
vrresetorg-agenda-reset-view
Clock
cIinorg-agenda-clock-in
cOoutorg-agenda-clock-out
cqcancelorg-agenda-clock-cancel
cjjumporg-agenda-clock-goto
Other
grreloadorg-agenda-redo
.go to todayorg-agenda-goto-today
gdgo to dateorg-agenda-goto-date

Pomodoro

Key bindingDescription
SPC m C pstarts a pomodoro

Presentation

org-present must be activated explicitly by typing: SPC SPC org-present

Key bindingDescription
hprevious slide
lnext slide
qquit

Helm-org-rifle

Key bindingDescription
SPC a o rSearch org files for keywords and headings

Org-projectile

Key bindingDescription
SPC a o pCapture a TODO for the current project
SPC u SPC a o pCapture a TODO for any given project (choose from list)
SPC p oGo to the TODOs for the current project

Org-journal

Key bindingDescription
SPC a o j jNew journal entry
SPC a o j sSearch journal entries

Journal entries are highlighted in the calendar. The following key bindings are available for calendar-mode for navigating and manipulating the journal.

Key bindingDescription
SPC m rRead journal entry
SPC m iInsert journal entry for date
SPC m nNext journal entry
SPC m pPrevious journal entry
SPC m sSearch all journal entries
SPC m wSearch calendar week journal entries
SPC m mSearch calendar month journal entries
SPC m ySearch calendar year journal entries

While viewing a journal entry in org-journal-mode the following key bindings are available.

Key bindingDescription
SPC m jNew journal entry
SPC m pPrevious journal entry
SPC m nNext journal entry

Org-brain

Application bindings

Key bindingDescription
SPC a o bVisualize an org-brain entry

Visualization bindings

Key bindingDescription
j / TABGoto next link
k / S-TABGoto previous link
cAdd child
pAdd parent
lAdd resource link
C-yPaste resource link
aAdd resource attachment
oOpen and edit the visualized entry
fFind/visit another entry to visualize
rRename this, or another, entry