<commit_before>#+TITLE: Org layer

[[file:img/org.png]]

* Table of Contents                                         :TOC_4_gh:noexport:
 - [[#description][Description]]
   - [[#features][Features:]]
   - [[#bibtex][BibTeX]]
   - [[#important-note][Important Note]]
 - [[#install][Install]]
   - [[#layer][Layer]]
   - [[#github-support][Github support]]
   - [[#gnuplot-support][Gnuplot support]]
   - [[#revealjs-support][Reveal.js support]]
   - [[#different-bullets][Different bullets]]
   - [[#project-support][Project support]]
 - [[#key-bindings][Key bindings]]
   - [[#org][Org]]
   - [[#org-with-evil-org-mode][Org with evil-org-mode]]
     - [[#tables][Tables]]
     - [[#tree][Tree]]
     - [[#element-insertion][Element insertion]]
     - [[#links][Links]]
     - [[#emphasis][Emphasis]]
     - [[#tagging][Tagging]]
     - [[#navigating-in-calendar][Navigating in calendar]]
   - [[#capture-buffers-and-src-blocks][Capture buffers and src blocks]]
   - [[#org-agenda][Org agenda]]
     - [[#keybindings][Keybindings]]
     - [[#org-agenda-transient-state][Org agenda transient state]]
   - [[#pomodoro][Pomodoro]]
   - [[#presentation][Presentation]]
   - [[#org-mime][Org-MIME]]
   - [[#org-download][Org-download]]
   - [[#org-projectile][Org-projectile]]

* Description
This layer enables [[http://orgmode.org/][org mode]] for Spacemacs.

** Features:
- Vim inspired key bindings are provided by [[https://github.com/edwtjo/evil-org-mode][evil-org-mode]]
- Nicer bullet via [[https://github.com/sabof/org-bullets][org-bullets]]
- A [[http://pomodorotechnique.com/][pomodoro method]] integration via [[https://github.com/lolownia/org-pomodoro][org-pomodoro]]
- Presentation mode via [[https://github.com/rlister/org-present][org-present]]
- Insertion of images via [[https://github.com/abo-abo/org-download][org-download]]
- Project-specific TODOs via [[https://github.com/IvanMalison/org-projectile][org-projectile]]

** BibTeX
For more extensive support of references through BibTeX files, have a look at
the [[../+lang/bibtex][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:

#+BEGIN_SRC emacs-lisp
  (with-eval-after-load 'org
    ;; here goes your Org config :)
    ;; ....
    )
#+END_SRC

* Install
** Layer
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =org= to the existing =dotspacemacs-configuration-layers= list in this
file.

** Github support
To install Github related extensions like [[https://github.com/larstvei/ox-gfm][ox-gfm]] to export to Github
flavored markdown set the variable =org-enable-github-support= to =t=.

#+BEGIN_SRC emacs-lisp
  (setq-default dotspacemacs-configuration-layers '(
    (org :variables org-enable-github-support t)))
#+END_SRC

** Gnuplot support
Org-mode support the plotting of data within tables through [[http://www.gnuplot.info/][Gnuplot]] as
demonstrated [[http://orgmode.org/worg/org-tutorials/org-plot.html][here]]; unfortunately, this is [[https://github.com/bruceravel/gnuplot-mode/issues/15][not terribly well supported]] on Windows
at this stage.  It is possible to disable the configuration of gnuplot support
as usual by adding the package =gnuplot= to your =dotspacemacs-excluded-packages=
variable.

** Reveal.js support
To enable the export of your org file as a [[http://lab.hakim.se/reveal-js/][reveal.js]] presentation, set the
variable =org-enable-reveal-js-support= to =t=. This will install the [[https://github.com/yjwen/org-reveal/][org-reveal]]
extension.

#+BEGIN_SRC emacs-lisp
  (setq-default dotspacemacs-configuration-layers
   '((org :variables org-enable-reveal-js-support t)))
#+END_SRC

In order to be able to use org-reveal, download =reveal.js= from its
[[http://lab.hakim.se/reveal-js/#/][homepage]] and set =org-reveal-js= to the
download path, as described in the [[https://github.com/yjwen/org-reveal#obtain-revealjs][manual]]. Alternatively, add the following line
to each =.org= file you want to process:

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

** 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 =("◉" "○" "✸" "✿")=.

#+BEGIN_SRC emacs-lisp
  (setq org-bullets-bullet-list '("■" "◆" "▲" "▶"))
#+END_SRC

** 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.

#+BEGIN_SRC emacs-lisp
  (setq-default dotspacemacs-configuration-layers
    '((org :variables org-projectile-file "TODOs.org")))
#+END_SRC

The TODO files are not added to the agenda automatically. You can do this with
the following snippet. Note that this may have unintended consequences until
[[https://github.com/IvanMalison/org-projectile/issues/10][this bug]] is fixed.

#+BEGIN_SRC emacs-lisp
  (with-eval-after-load 'org-agenda
    (require 'org-projectile)
    (push (org-projectile:todo-files) org-agenda-files))
#+END_SRC

* Key bindings
** Org

| Key Binding | Description                    |
|-------------+--------------------------------|
| ~SPC a o #~ | org agenda list stuck projects |
| ~SPC a o /~ | org occur in agenda files      |
| ~SPC a o a~ | org agenda list                |
| ~SPC a o c~ | org capture                    |
| ~SPC a o e~ | org store agenda views         |
| ~SPC a o l~ | org store link                 |
| ~SPC a o m~ | org tags view                  |
| ~SPC a o o~ | org agenda                     |
| ~SPC a o O~ | org clock out                  |<commit_msg>Mention mode line support for org clock<commit_after>#+TITLE: Org layer

[[file:img/org.png]]

* Table of Contents                                         :TOC_4_gh:noexport:
 - [[#description][Description]]
   - [[#features][Features:]]
   - [[#bibtex][BibTeX]]
   - [[#important-note][Important Note]]
 - [[#install][Install]]
   - [[#layer][Layer]]
   - [[#github-support][Github support]]
   - [[#gnuplot-support][Gnuplot support]]
   - [[#revealjs-support][Reveal.js support]]
   - [[#different-bullets][Different bullets]]
   - [[#project-support][Project support]]
   - [[#mode-line-support][Mode line support]]
 - [[#key-bindings][Key bindings]]
   - [[#org][Org]]
   - [[#org-with-evil-org-mode][Org with evil-org-mode]]
     - [[#tables][Tables]]
     - [[#tree][Tree]]
     - [[#element-insertion][Element insertion]]
     - [[#links][Links]]
     - [[#emphasis][Emphasis]]
     - [[#tagging][Tagging]]
     - [[#navigating-in-calendar][Navigating in calendar]]
   - [[#capture-buffers-and-src-blocks][Capture buffers and src blocks]]
   - [[#org-agenda][Org agenda]]
     - [[#keybindings][Keybindings]]
     - [[#org-agenda-transient-state][Org agenda transient state]]
   - [[#pomodoro][Pomodoro]]
   - [[#presentation][Presentation]]
   - [[#org-mime][Org-MIME]]
   - [[#org-download][Org-download]]
   - [[#org-projectile][Org-projectile]]

* Description
This layer enables [[http://orgmode.org/][org mode]] for Spacemacs.

** Features:
- Vim inspired key bindings are provided by [[https://github.com/edwtjo/evil-org-mode][evil-org-mode]]
- Nicer bullet via [[https://github.com/sabof/org-bullets][org-bullets]]
- A [[http://pomodorotechnique.com/][pomodoro method]] integration via [[https://github.com/lolownia/org-pomodoro][org-pomodoro]]
- Presentation mode via [[https://github.com/rlister/org-present][org-present]]
- Insertion of images via [[https://github.com/abo-abo/org-download][org-download]]
- Project-specific TODOs via [[https://github.com/IvanMalison/org-projectile][org-projectile]]

** BibTeX
For more extensive support of references through BibTeX files, have a look at
the [[../+lang/bibtex][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:

#+BEGIN_SRC emacs-lisp
  (with-eval-after-load 'org
    ;; here goes your Org config :)
    ;; ....
    )
#+END_SRC

* Install
** Layer
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =org= to the existing =dotspacemacs-configuration-layers= list in this
file.

** Github support
To install Github related extensions like [[https://github.com/larstvei/ox-gfm][ox-gfm]] to export to Github
flavored markdown set the variable =org-enable-github-support= to =t=.

#+BEGIN_SRC emacs-lisp
  (setq-default dotspacemacs-configuration-layers '(
    (org :variables org-enable-github-support t)))
#+END_SRC

** Gnuplot support
Org-mode support the plotting of data within tables through [[http://www.gnuplot.info/][Gnuplot]] as
demonstrated [[http://orgmode.org/worg/org-tutorials/org-plot.html][here]]; unfortunately, this is [[https://github.com/bruceravel/gnuplot-mode/issues/15][not terribly well supported]] on Windows
at this stage.  It is possible to disable the configuration of gnuplot support
as usual by adding the package =gnuplot= to your =dotspacemacs-excluded-packages=
variable.

** Reveal.js support
To enable the export of your org file as a [[http://lab.hakim.se/reveal-js/][reveal.js]] presentation, set the
variable =org-enable-reveal-js-support= to =t=. This will install the [[https://github.com/yjwen/org-reveal/][org-reveal]]
extension.

#+BEGIN_SRC emacs-lisp
  (setq-default dotspacemacs-configuration-layers
   '((org :variables org-enable-reveal-js-support t)))
#+END_SRC

In order to be able to use org-reveal, download =reveal.js= from its
[[http://lab.hakim.se/reveal-js/#/][homepage]] and set =org-reveal-js= to the
download path, as described in the [[https://github.com/yjwen/org-reveal#obtain-revealjs][manual]]. Alternatively, add the following line
to each =.org= file you want to process:

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

** 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 =("◉" "○" "✸" "✿")=.

#+BEGIN_SRC emacs-lisp
  (setq org-bullets-bullet-list '("■" "◆" "▲" "▶"))
#+END_SRC

** 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.

#+BEGIN_SRC emacs-lisp
  (setq-default dotspacemacs-configuration-layers
    '((org :variables org-projectile-file "TODOs.org")))
#+END_SRC

The TODO files are not added to the agenda automatically. You can do this with
the following snippet. Note that this may have unintended consequences until
[[https://github.com/IvanMalison/org-projectile/issues/10][this bug]] is fixed.

#+BEGIN_SRC emacs-lisp
  (with-eval-after-load 'org-agenda
    (require 'org-projectile)
    (push (org-projectile:todo-files) org-agenda-files))
#+END_SRC

** 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:

#+BEGIN_SRC elisp
  (setq spaceline-org-clock-p t)
#+END_SRC

* Key bindings
** Org

| Key Binding | Description                    |
|-------------+--------------------------------|
| ~SPC a o #~ | org agenda list stuck projects |
| ~SPC a o /~ | org occur in agenda files      |
| ~SPC a o a~ | org agenda list                |
| ~SPC a o c~ | org capture                    |
| ~SPC a o e~ | org store agenda views         |
| ~SPC a o l~ | org store link                 |
| ~SPC a o m~ | org tags view                  |
| ~SPC a o o~ | org agenda                     |
| ~SPC a o O~ | org clock out                  |
{'fraction_non_alphanumeric': 0.15034504148251532, 'fraction_numerical': 0.0018608978832286578, 'mean_word_length': 3.544749823819591, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 22, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 17, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5296982', 'n_tokens_mistral': 4361, 'n_tokens_neox': 4137, 'n_words': 1252}