2015-04-11 04:13:02 +00:00
|
|
|
|
;;; packages.el --- Org Layer packages File for Spacemacs
|
|
|
|
|
;;
|
2017-01-06 03:51:13 +00:00
|
|
|
|
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
|
2015-04-11 04:13:02 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
|
;;
|
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
;;
|
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
2015-04-19 03:40:24 +00:00
|
|
|
|
(setq org-packages
|
2015-04-11 04:13:02 +00:00
|
|
|
|
'(
|
2015-08-27 01:55:28 +00:00
|
|
|
|
company
|
|
|
|
|
company-emoji
|
|
|
|
|
emoji-cheat-sheet-plus
|
2016-04-08 02:04:36 +00:00
|
|
|
|
(evil-org :location local)
|
2015-11-05 16:34:06 +00:00
|
|
|
|
evil-surround
|
2015-09-08 01:31:14 +00:00
|
|
|
|
gnuplot
|
2015-06-01 04:12:30 +00:00
|
|
|
|
htmlize
|
2016-03-23 14:17:46 +00:00
|
|
|
|
;; ob, org and org-agenda are installed by `org-plus-contrib'
|
|
|
|
|
(ob :location built-in)
|
2015-09-24 02:03:38 +00:00
|
|
|
|
(org :location built-in)
|
2015-11-17 18:52:20 +00:00
|
|
|
|
(org-agenda :location built-in)
|
2016-09-03 22:28:24 +00:00
|
|
|
|
(org-expiry :location built-in)
|
2016-09-07 03:10:13 +00:00
|
|
|
|
(org-journal :toggle org-enable-org-journal-support)
|
2016-04-22 03:26:57 +00:00
|
|
|
|
org-download
|
2015-09-24 02:04:07 +00:00
|
|
|
|
;; org-mime is installed by `org-plus-contrib'
|
|
|
|
|
(org-mime :location built-in)
|
2017-03-21 17:03:20 +00:00
|
|
|
|
;; org-notmuch and org-mu4e are installed by `org-plus-contrib'
|
|
|
|
|
(org-notmuch :location built-in :toggle (configuration-layer/package-usedp 'notmuch))
|
|
|
|
|
(org-mu4e :location built-in :toggle (configuration-layer/package-usedp 'mu4e))
|
2015-04-11 04:13:02 +00:00
|
|
|
|
org-pomodoro
|
2015-05-14 04:17:12 +00:00
|
|
|
|
org-present
|
2016-06-14 09:35:54 +00:00
|
|
|
|
(org-projectile :toggle (configuration-layer/package-usedp 'projectile))
|
2016-09-24 01:06:57 +00:00
|
|
|
|
(ox-twbs :toggle org-enable-bootstrap-support)
|
2016-06-02 02:37:16 +00:00
|
|
|
|
;; use a for of ox-gfm to fix index generation
|
|
|
|
|
(ox-gfm :location (recipe :fetcher github :repo "syl20bnr/ox-gfm")
|
|
|
|
|
:toggle org-enable-github-support)
|
2016-06-02 02:05:46 +00:00
|
|
|
|
(ox-reveal :toggle org-enable-reveal-js-support)
|
2015-11-09 04:51:29 +00:00
|
|
|
|
persp-mode
|
2015-04-19 03:40:24 +00:00
|
|
|
|
))
|
2015-04-13 07:38:01 +00:00
|
|
|
|
|
2016-05-30 02:39:21 +00:00
|
|
|
|
(defun org/post-init-company ()
|
2017-01-02 05:39:04 +00:00
|
|
|
|
(spacemacs|add-company-backends :backends company-capf :modes org-mode))
|
2016-05-30 02:39:21 +00:00
|
|
|
|
|
|
|
|
|
(defun org/post-init-company-emoji ()
|
2017-01-02 05:39:04 +00:00
|
|
|
|
(spacemacs|add-company-backends :backends company-emoji :modes org-mode))
|
2015-08-27 01:55:28 +00:00
|
|
|
|
|
|
|
|
|
(defun org/post-init-emoji-cheat-sheet-plus ()
|
|
|
|
|
(add-hook 'org-mode-hook 'spacemacs/delay-emoji-cheat-sheet-hook))
|
|
|
|
|
|
2016-04-08 02:04:36 +00:00
|
|
|
|
(defun org/init-evil-org ()
|
2015-04-11 04:13:02 +00:00
|
|
|
|
(use-package evil-org
|
2016-04-08 02:04:36 +00:00
|
|
|
|
:commands (evil-org-mode evil-org-recompute-clocks)
|
|
|
|
|
:init (add-hook 'org-mode-hook 'evil-org-mode)
|
2015-04-11 04:13:02 +00:00
|
|
|
|
:config
|
|
|
|
|
(progn
|
2016-04-08 02:04:36 +00:00
|
|
|
|
(evil-define-key 'normal evil-org-mode-map
|
|
|
|
|
"O" 'evil-open-above)
|
2015-11-18 00:38:05 +00:00
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'org-mode
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"Cg" 'evil-org-recompute-clocks)
|
2016-04-08 02:04:36 +00:00
|
|
|
|
(spacemacs|diminish evil-org-mode " ⓔ" " e"))))
|
2015-04-11 04:13:02 +00:00
|
|
|
|
|
2015-11-05 16:34:06 +00:00
|
|
|
|
(defun org/post-init-evil-surround ()
|
|
|
|
|
(defun spacemacs/add-org-surrounds ()
|
2016-04-19 10:29:05 +00:00
|
|
|
|
(push '(?: . spacemacs//surround-drawer) evil-surround-pairs-alist)
|
|
|
|
|
(push '(?# . spacemacs//surround-code) evil-surround-pairs-alist))
|
|
|
|
|
(add-hook 'org-mode-hook 'spacemacs/add-org-surrounds))
|
2015-11-05 16:34:06 +00:00
|
|
|
|
|
2015-09-08 01:31:14 +00:00
|
|
|
|
(defun org/init-gnuplot ()
|
|
|
|
|
(use-package gnuplot
|
2015-09-10 02:24:17 +00:00
|
|
|
|
:defer t
|
2015-11-18 00:38:05 +00:00
|
|
|
|
:init (spacemacs/set-leader-keys-for-major-mode 'org-mode
|
|
|
|
|
"tp" 'org-plot/gnuplot)))
|
2015-09-08 01:31:14 +00:00
|
|
|
|
|
2016-06-02 02:07:24 +00:00
|
|
|
|
(defun org/init-htmlize ()
|
|
|
|
|
(use-package htmlize
|
|
|
|
|
:defer t))
|
|
|
|
|
|
2017-03-21 17:03:20 +00:00
|
|
|
|
(defun org/init-org-mu4e ()
|
|
|
|
|
(with-eval-after-load 'org
|
|
|
|
|
(require 'org-mu4e)))
|
|
|
|
|
|
|
|
|
|
(defun org/init-org-notmuch ()
|
|
|
|
|
(with-eval-after-load 'org
|
|
|
|
|
(require 'org-notmuch)))
|
2016-01-12 04:20:20 +00:00
|
|
|
|
|
2016-03-23 14:17:46 +00:00
|
|
|
|
(defun org/init-ob ()
|
|
|
|
|
(use-package ob
|
|
|
|
|
:defer t
|
|
|
|
|
:init
|
|
|
|
|
(progn
|
|
|
|
|
(defun spacemacs//org-babel-do-load-languages ()
|
|
|
|
|
"Load all the languages declared in `org-babel-load-languages'."
|
|
|
|
|
(org-babel-do-load-languages 'org-babel-load-languages
|
|
|
|
|
org-babel-load-languages))
|
2016-04-30 02:47:26 +00:00
|
|
|
|
(add-hook 'org-mode-hook 'spacemacs//org-babel-do-load-languages)
|
|
|
|
|
;; Fix redisplay of inline images after a code block evaluation.
|
|
|
|
|
(add-hook 'org-babel-after-execute-hook 'spacemacs/ob-fix-inline-images))))
|
2016-03-23 14:17:46 +00:00
|
|
|
|
|
2016-04-08 02:04:36 +00:00
|
|
|
|
(defun org/init-org ()
|
2015-04-11 04:13:02 +00:00
|
|
|
|
(use-package org
|
2016-04-08 02:04:36 +00:00
|
|
|
|
:defer t
|
2016-06-04 21:47:22 +00:00
|
|
|
|
:commands (orgtbl-mode)
|
2015-04-11 04:13:02 +00:00
|
|
|
|
:init
|
|
|
|
|
(progn
|
2016-03-12 18:42:48 +00:00
|
|
|
|
(setq org-clock-persist-file (concat spacemacs-cache-directory
|
|
|
|
|
"org-clock-save.el")
|
|
|
|
|
org-id-locations-file (concat spacemacs-cache-directory
|
|
|
|
|
".org-id-locations")
|
|
|
|
|
org-publish-timestamp-directory (concat spacemacs-cache-directory
|
|
|
|
|
".org-timestamps/")
|
2015-06-16 02:28:36 +00:00
|
|
|
|
org-log-done t
|
2015-06-15 21:23:42 +00:00
|
|
|
|
org-startup-with-inline-images t
|
2016-06-10 19:50:05 +00:00
|
|
|
|
org-image-actual-width nil
|
2016-01-11 18:16:07 +00:00
|
|
|
|
org-src-fontify-natively t
|
|
|
|
|
;; this is consistent with the value of
|
|
|
|
|
;; `helm-org-headings-max-depth'.
|
|
|
|
|
org-imenu-depth 8)
|
2015-04-11 04:38:31 +00:00
|
|
|
|
|
2015-09-29 05:07:57 +00:00
|
|
|
|
(with-eval-after-load 'org-indent
|
|
|
|
|
(spacemacs|hide-lighter org-indent-mode))
|
2016-07-17 19:00:43 +00:00
|
|
|
|
(let ((dir (configuration-layer/get-layer-local-dir 'org)))
|
2015-05-16 04:57:13 +00:00
|
|
|
|
(setq org-export-async-init-file (concat dir "org-async-init.el")))
|
2015-04-13 08:09:50 +00:00
|
|
|
|
(defmacro spacemacs|org-emphasize (fname char)
|
2015-04-14 20:36:02 +00:00
|
|
|
|
"Make function for setting the emphasis in org mode"
|
2015-04-13 08:09:50 +00:00
|
|
|
|
`(defun ,fname () (interactive)
|
2015-05-08 03:06:38 +00:00
|
|
|
|
(org-emphasize ,char)))
|
2015-05-13 17:15:14 +00:00
|
|
|
|
|
2016-01-19 06:21:34 +00:00
|
|
|
|
;; Follow the confirm and abort conventions
|
|
|
|
|
(with-eval-after-load 'org-capture
|
|
|
|
|
(spacemacs/set-leader-keys-for-minor-mode 'org-capture-mode
|
|
|
|
|
dotspacemacs-major-mode-leader-key 'org-capture-finalize
|
2016-09-25 00:47:44 +00:00
|
|
|
|
"a" 'org-capture-kill
|
2016-01-19 06:21:34 +00:00
|
|
|
|
"c" 'org-capture-finalize
|
|
|
|
|
"k" 'org-capture-kill
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"r" 'org-capture-refile))
|
2016-01-19 06:21:34 +00:00
|
|
|
|
|
|
|
|
|
(with-eval-after-load 'org-src
|
|
|
|
|
(spacemacs/set-leader-keys-for-minor-mode 'org-src-mode
|
2016-12-16 13:52:32 +00:00
|
|
|
|
dotspacemacs-major-mode-leader-key 'org-edit-src-exit
|
2016-01-19 06:21:34 +00:00
|
|
|
|
"c" 'org-edit-src-exit
|
|
|
|
|
"a" 'org-edit-src-abort
|
|
|
|
|
"k" 'org-edit-src-abort))
|
|
|
|
|
|
2016-07-17 19:00:43 +00:00
|
|
|
|
(let ((dir (configuration-layer/get-layer-local-dir 'org)))
|
2016-03-05 11:56:30 +00:00
|
|
|
|
(setq org-export-async-init-file (concat dir "org-async-init.el")))
|
|
|
|
|
(defmacro spacemacs|org-emphasize (fname char)
|
|
|
|
|
"Make function for setting the emphasis in org mode"
|
|
|
|
|
`(defun ,fname () (interactive)
|
|
|
|
|
(org-emphasize ,char)))
|
|
|
|
|
|
2015-05-13 17:15:14 +00:00
|
|
|
|
;; Insert key for org-mode and markdown a la C-h k
|
|
|
|
|
;; from SE endless http://emacs.stackexchange.com/questions/2206/i-want-to-have-the-kbd-tags-for-my-blog-written-in-org-mode/2208#2208
|
|
|
|
|
(defun spacemacs/insert-keybinding-org (key)
|
|
|
|
|
"Ask for a key then insert its description.
|
|
|
|
|
Will work on both org-mode and any mode that accepts plain html."
|
|
|
|
|
(interactive "kType key sequence: ")
|
|
|
|
|
(let* ((tag "@@html:<kbd>@@ %s @@html:</kbd>@@"))
|
|
|
|
|
(if (null (equal key "\r"))
|
|
|
|
|
(insert
|
|
|
|
|
(format tag (help-key-description key nil)))
|
|
|
|
|
(insert (format tag ""))
|
|
|
|
|
(forward-char -8))))
|
2016-05-16 09:43:01 +00:00
|
|
|
|
|
2017-05-04 04:23:00 +00:00
|
|
|
|
(dolist (prefix '(
|
|
|
|
|
("mC" . "clocks")
|
|
|
|
|
("md" . "dates")
|
|
|
|
|
("me" . "export")
|
2016-05-16 09:43:01 +00:00
|
|
|
|
("mh" . "headings")
|
|
|
|
|
("mi" . "insert")
|
2017-05-04 04:23:00 +00:00
|
|
|
|
("miD" . "download")
|
|
|
|
|
("ms" . "trees/subtrees")
|
|
|
|
|
("mT" . "toggles")
|
2016-05-16 09:43:01 +00:00
|
|
|
|
("mt" . "tables")
|
|
|
|
|
("mtd" . "delete")
|
|
|
|
|
("mti" . "insert")
|
2017-05-04 04:23:00 +00:00
|
|
|
|
("mtt" . "toggle")
|
|
|
|
|
("mx" . "text")
|
|
|
|
|
))
|
2016-05-16 09:43:01 +00:00
|
|
|
|
(spacemacs/declare-prefix-for-mode 'org-mode (car prefix) (cdr prefix)))
|
2015-11-18 00:38:05 +00:00
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'org-mode
|
|
|
|
|
"'" 'org-edit-special
|
|
|
|
|
"c" 'org-capture
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"Cc" 'org-clock-cancel
|
|
|
|
|
"Ci" 'org-clock-in
|
|
|
|
|
"Co" 'org-clock-out
|
|
|
|
|
"dd" 'org-deadline
|
|
|
|
|
"ds" 'org-schedule
|
|
|
|
|
"dt" 'org-time-stamp
|
|
|
|
|
"dT" 'org-time-stamp-inactive
|
2016-11-18 14:40:05 +00:00
|
|
|
|
"ee" 'org-export-dispatch
|
2015-11-18 00:38:05 +00:00
|
|
|
|
|
|
|
|
|
"a" 'org-agenda
|
2017-05-01 10:40:48 +00:00
|
|
|
|
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"Tt" 'org-show-todo-tree
|
|
|
|
|
"Ti" 'org-toggle-inline-images
|
|
|
|
|
"TV" 'space-doc-mode
|
|
|
|
|
"Tx" 'org-toggle-latex-fragment
|
2015-05-08 03:06:38 +00:00
|
|
|
|
|
2015-12-06 06:14:53 +00:00
|
|
|
|
;; More cycling options (timestamps, headlines, items, properties)
|
|
|
|
|
"L" 'org-shiftright
|
|
|
|
|
"H" 'org-shiftleft
|
|
|
|
|
"J" 'org-shiftdown
|
|
|
|
|
"K" 'org-shiftup
|
|
|
|
|
|
2015-09-16 20:08:55 +00:00
|
|
|
|
;; Change between TODO sets
|
2015-11-18 00:38:05 +00:00
|
|
|
|
"C-S-l" 'org-shiftcontrolright
|
|
|
|
|
"C-S-h" 'org-shiftcontrolleft
|
|
|
|
|
"C-S-j" 'org-shiftcontroldown
|
|
|
|
|
"C-S-k" 'org-shiftcontrolup
|
2015-09-16 20:08:55 +00:00
|
|
|
|
|
|
|
|
|
;; Subtree editing
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"sa" 'org-archive-subtree
|
|
|
|
|
"sb" 'org-tree-to-indirect-buffer
|
|
|
|
|
"sh" 'org-promote-subtree
|
|
|
|
|
"sj" 'org-move-subtree-down
|
|
|
|
|
"sk" 'org-move-subtree-up
|
|
|
|
|
"sl" 'org-demote-subtree
|
|
|
|
|
"sn" 'org-narrow-to-subtree
|
|
|
|
|
"sN" 'widen
|
|
|
|
|
"sr" 'org-refile
|
|
|
|
|
"ss" 'org-sparse-tree
|
|
|
|
|
"sS" 'org-sort
|
2015-09-16 20:08:55 +00:00
|
|
|
|
|
2015-09-08 01:34:45 +00:00
|
|
|
|
;; tables
|
2015-11-18 00:38:05 +00:00
|
|
|
|
"ta" 'org-table-align
|
|
|
|
|
"tb" 'org-table-blank-field
|
|
|
|
|
"tc" 'org-table-convert
|
|
|
|
|
"tdc" 'org-table-delete-column
|
|
|
|
|
"tdr" 'org-table-kill-row
|
|
|
|
|
"te" 'org-table-eval-formula
|
|
|
|
|
"tE" 'org-table-export
|
|
|
|
|
"th" 'org-table-previous-field
|
|
|
|
|
"tH" 'org-table-move-column-left
|
|
|
|
|
"tic" 'org-table-insert-column
|
|
|
|
|
"tih" 'org-table-insert-hline
|
|
|
|
|
"tiH" 'org-table-hline-and-move
|
|
|
|
|
"tir" 'org-table-insert-row
|
|
|
|
|
"tI" 'org-table-import
|
|
|
|
|
"tj" 'org-table-next-row
|
|
|
|
|
"tJ" 'org-table-move-row-down
|
|
|
|
|
"tK" 'org-table-move-row-up
|
|
|
|
|
"tl" 'org-table-next-field
|
|
|
|
|
"tL" 'org-table-move-column-right
|
|
|
|
|
"tn" 'org-table-create
|
|
|
|
|
"tN" 'org-table-create-with-table.el
|
|
|
|
|
"tr" 'org-table-recalculate
|
|
|
|
|
"ts" 'org-table-sort-lines
|
|
|
|
|
"ttf" 'org-table-toggle-formula-debugger
|
|
|
|
|
"tto" 'org-table-toggle-coordinate-overlays
|
|
|
|
|
"tw" 'org-table-wrap-region
|
2015-09-08 01:34:45 +00:00
|
|
|
|
|
2015-11-05 16:33:46 +00:00
|
|
|
|
;; Multi-purpose keys
|
2015-11-21 18:38:55 +00:00
|
|
|
|
(or dotspacemacs-major-mode-leader-key ",") 'org-ctrl-c-ctrl-c
|
2015-11-18 00:38:05 +00:00
|
|
|
|
"*" 'org-ctrl-c-star
|
|
|
|
|
"RET" 'org-ctrl-c-ret
|
|
|
|
|
"-" 'org-ctrl-c-minus
|
2017-04-18 02:19:47 +00:00
|
|
|
|
;; insertion
|
|
|
|
|
"ia" 'org-attach
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"id" 'org-insert-drawer
|
|
|
|
|
"ie" 'org-set-effort
|
2017-04-18 02:19:47 +00:00
|
|
|
|
"if" 'org-footnote-new
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"ih" 'org-insert-heading
|
|
|
|
|
"iH" 'org-insert-heading-after-current
|
|
|
|
|
"iK" 'spacemacs/insert-keybinding-org
|
|
|
|
|
"il" 'org-insert-link
|
|
|
|
|
"ip" 'org-set-property
|
|
|
|
|
"is" 'org-insert-subheading
|
|
|
|
|
"it" 'org-set-tags
|
2015-11-05 16:33:46 +00:00
|
|
|
|
;; region manipulation
|
2015-11-21 18:33:11 +00:00
|
|
|
|
"xb" (spacemacs|org-emphasize spacemacs/org-bold ?*)
|
|
|
|
|
"xc" (spacemacs|org-emphasize spacemacs/org-code ?~)
|
|
|
|
|
"xi" (spacemacs|org-emphasize spacemacs/org-italic ?/)
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"xo" 'org-open-at-point
|
2015-11-21 18:33:11 +00:00
|
|
|
|
"xr" (spacemacs|org-emphasize spacemacs/org-clear ? )
|
|
|
|
|
"xs" (spacemacs|org-emphasize spacemacs/org-strike-through ?+)
|
|
|
|
|
"xu" (spacemacs|org-emphasize spacemacs/org-underline ?_)
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"xv" (spacemacs|org-emphasize spacemacs/org-verbose ?=))
|
2015-04-11 04:13:02 +00:00
|
|
|
|
|
2015-10-12 18:22:32 +00:00
|
|
|
|
;; Add global evil-leader mappings. Used to access org-agenda
|
|
|
|
|
;; functionalities – and a few others commands – from any other mode.
|
2015-11-09 20:26:39 +00:00
|
|
|
|
(spacemacs/declare-prefix "ao" "org")
|
2016-10-09 17:09:39 +00:00
|
|
|
|
(spacemacs/declare-prefix "aok" "clock")
|
2015-11-18 00:38:05 +00:00
|
|
|
|
(spacemacs/set-leader-keys
|
2015-10-12 18:22:32 +00:00
|
|
|
|
;; org-agenda
|
|
|
|
|
"ao#" 'org-agenda-list-stuck-projects
|
|
|
|
|
"ao/" 'org-occur-in-agenda-files
|
|
|
|
|
"aoa" 'org-agenda-list
|
2016-10-09 17:09:39 +00:00
|
|
|
|
"aoc" 'org-capture
|
2015-10-12 18:22:32 +00:00
|
|
|
|
"aoe" 'org-store-agenda-views
|
2016-10-09 17:09:39 +00:00
|
|
|
|
"aoki" 'org-clock-in-last
|
|
|
|
|
"aokj" 'org-clock-jump-to-current-clock
|
|
|
|
|
"aoko" 'org-clock-out
|
|
|
|
|
"aol" 'org-store-link
|
2015-10-12 18:22:32 +00:00
|
|
|
|
"aom" 'org-tags-view
|
|
|
|
|
"aoo" 'org-agenda
|
|
|
|
|
"aos" 'org-search-view
|
2017-05-10 23:36:00 +00:00
|
|
|
|
"aot" 'org-todo-list
|
|
|
|
|
;; SPC C- capture/colors
|
|
|
|
|
"Cc" 'org-capture)
|
2016-02-17 08:28:51 +00:00
|
|
|
|
|
|
|
|
|
(define-key global-map "\C-cl" 'org-store-link)
|
|
|
|
|
(define-key global-map "\C-ca" 'org-agenda)
|
|
|
|
|
(define-key global-map "\C-cc" 'org-capture))
|
2015-04-11 04:13:02 +00:00
|
|
|
|
:config
|
|
|
|
|
(progn
|
2016-01-12 19:47:03 +00:00
|
|
|
|
(setq org-default-notes-file "notes.org")
|
2015-10-05 11:40:47 +00:00
|
|
|
|
|
2015-06-03 03:27:00 +00:00
|
|
|
|
;; We add this key mapping because an Emacs user can change
|
|
|
|
|
;; `dotspacemacs-major-mode-emacs-leader-key' to `C-c' and the key binding
|
|
|
|
|
;; C-c ' is shadowed by `spacemacs/default-pop-shell', effectively making
|
|
|
|
|
;; the Emacs user unable to exit src block editing.
|
2016-03-23 14:17:46 +00:00
|
|
|
|
(define-key org-src-mode-map
|
|
|
|
|
(kbd (concat dotspacemacs-major-mode-emacs-leader-key " '"))
|
|
|
|
|
'org-edit-src-exit)
|
2015-06-03 03:27:00 +00:00
|
|
|
|
|
2015-11-17 18:52:20 +00:00
|
|
|
|
;; Evilify the calendar tool on C-c .
|
|
|
|
|
(unless (eq 'emacs dotspacemacs-editing-style)
|
|
|
|
|
(define-key org-read-date-minibuffer-local-map (kbd "M-h")
|
2016-03-23 14:17:46 +00:00
|
|
|
|
(lambda () (interactive)
|
|
|
|
|
(org-eval-in-calendar '(calendar-backward-day 1))))
|
2015-11-17 18:52:20 +00:00
|
|
|
|
(define-key org-read-date-minibuffer-local-map (kbd "M-l")
|
2016-03-23 14:17:46 +00:00
|
|
|
|
(lambda () (interactive)
|
|
|
|
|
(org-eval-in-calendar '(calendar-forward-day 1))))
|
2015-11-17 18:52:20 +00:00
|
|
|
|
(define-key org-read-date-minibuffer-local-map (kbd "M-k")
|
2016-03-23 14:17:46 +00:00
|
|
|
|
(lambda () (interactive)
|
|
|
|
|
(org-eval-in-calendar '(calendar-backward-week 1))))
|
2015-11-17 18:52:20 +00:00
|
|
|
|
(define-key org-read-date-minibuffer-local-map (kbd "M-j")
|
2016-03-23 14:17:46 +00:00
|
|
|
|
(lambda () (interactive)
|
|
|
|
|
(org-eval-in-calendar '(calendar-forward-week 1))))
|
2015-11-17 18:52:20 +00:00
|
|
|
|
(define-key org-read-date-minibuffer-local-map (kbd "M-H")
|
2016-03-23 14:17:46 +00:00
|
|
|
|
(lambda () (interactive)
|
|
|
|
|
(org-eval-in-calendar '(calendar-backward-month 1))))
|
2015-11-17 18:52:20 +00:00
|
|
|
|
(define-key org-read-date-minibuffer-local-map (kbd "M-L")
|
2016-03-23 14:17:46 +00:00
|
|
|
|
(lambda () (interactive)
|
|
|
|
|
(org-eval-in-calendar '(calendar-forward-month 1))))
|
2015-11-17 18:52:20 +00:00
|
|
|
|
(define-key org-read-date-minibuffer-local-map (kbd "M-K")
|
2016-03-23 14:17:46 +00:00
|
|
|
|
(lambda () (interactive)
|
|
|
|
|
(org-eval-in-calendar '(calendar-backward-year 1))))
|
2015-11-17 18:52:20 +00:00
|
|
|
|
(define-key org-read-date-minibuffer-local-map (kbd "M-J")
|
2016-03-23 14:17:46 +00:00
|
|
|
|
(lambda () (interactive)
|
|
|
|
|
(org-eval-in-calendar '(calendar-forward-year 1))))))))
|
2015-11-17 18:52:20 +00:00
|
|
|
|
|
|
|
|
|
(defun org/init-org-agenda ()
|
|
|
|
|
(use-package org-agenda
|
|
|
|
|
:defer t
|
|
|
|
|
:init
|
2016-01-08 09:33:50 +00:00
|
|
|
|
(progn
|
|
|
|
|
(setq org-agenda-restore-windows-after-quit t)
|
2017-05-04 04:23:00 +00:00
|
|
|
|
(dolist (prefix '(("mC" . "clocks")
|
|
|
|
|
("md" . "dates")
|
|
|
|
|
("mi" . "insert")
|
|
|
|
|
("ms" . "trees/subtrees")))
|
|
|
|
|
(spacemacs/declare-prefix-for-mode 'org-agenda-mode
|
|
|
|
|
(car prefix) (cdr prefix)))
|
2016-01-08 09:33:50 +00:00
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'org-agenda-mode
|
2016-01-23 16:31:51 +00:00
|
|
|
|
"a" 'org-agenda
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"Cc" 'org-agenda-clock-cancel
|
|
|
|
|
"Ci" 'org-agenda-clock-in
|
|
|
|
|
"Co" 'org-agenda-clock-out
|
|
|
|
|
"dd" 'org-agenda-deadline
|
|
|
|
|
"ds" 'org-agenda-schedule
|
|
|
|
|
"ie" 'org-agenda-set-effort
|
|
|
|
|
"ip" 'org-agenda-set-property
|
|
|
|
|
"it" 'org-agenda-set-tags
|
|
|
|
|
"sr" 'org-agenda-refile)
|
2016-02-20 14:30:18 +00:00
|
|
|
|
(spacemacs|define-transient-state org-agenda
|
|
|
|
|
:title "Org-agenda transient state"
|
|
|
|
|
:on-enter (setq which-key-inhibit t)
|
|
|
|
|
:on-exit (setq which-key-inhibit nil)
|
|
|
|
|
:foreign-keys run
|
|
|
|
|
:doc
|
|
|
|
|
"
|
|
|
|
|
Headline^^ Visit entry^^ Filter^^ Date^^ Toggle mode^^ View^^ Clock^^ Other^^
|
|
|
|
|
--------^^--------- -----------^^------------ ------^^----------------- ----^^------------- -----------^^------ ----^^--------- -----^^------ -----^^-----------
|
2016-09-25 00:47:44 +00:00
|
|
|
|
[_ht_] set status [_SPC_] in other window [_ft_] by tag [_ds_] schedule [_tf_] follow [_vd_] day [_cI_] in [_gr_] reload
|
|
|
|
|
[_hk_] kill [_TAB_] & go to location [_fr_] refine by tag [_dd_] set deadline [_tl_] log [_vw_] week [_cO_] out [_._] go to today
|
|
|
|
|
[_hR_] refile [_RET_] & del other windows [_fc_] by category [_dt_] timestamp [_ta_] archive [_vt_] fortnight [_cq_] cancel [_gd_] go to date
|
2016-02-20 14:30:18 +00:00
|
|
|
|
[_hA_] archive [_o_] link [_fh_] by top headline [_+_] do later [_tr_] clock report [_vm_] month [_cj_] jump ^^
|
2016-09-25 00:47:44 +00:00
|
|
|
|
[_h:_] set tags ^^ [_fx_] by regexp [_-_] do earlier [_td_] diaries [_vy_] year ^^ ^^
|
2016-02-20 14:30:18 +00:00
|
|
|
|
[_hp_] set priority ^^ [_fd_] delete all filters ^^ ^^ [_vn_] next span ^^ ^^
|
|
|
|
|
^^ ^^ ^^ ^^ ^^ [_vp_] prev span ^^ ^^
|
|
|
|
|
^^ ^^ ^^ ^^ ^^ [_vr_] reset ^^ ^^
|
|
|
|
|
[_q_] quit
|
|
|
|
|
"
|
|
|
|
|
:bindings
|
|
|
|
|
;; Entry
|
2016-09-25 00:47:44 +00:00
|
|
|
|
("h:" org-agenda-set-tags)
|
2016-02-20 14:30:18 +00:00
|
|
|
|
("hA" org-agenda-archive-default)
|
2016-09-25 00:47:44 +00:00
|
|
|
|
("hk" org-agenda-kill)
|
2016-02-20 14:30:18 +00:00
|
|
|
|
("hp" org-agenda-priority)
|
2016-09-25 00:47:44 +00:00
|
|
|
|
("hR" org-agenda-refile)
|
|
|
|
|
("ht" org-agenda-todo)
|
2016-02-20 14:30:18 +00:00
|
|
|
|
|
|
|
|
|
;; Visit entry
|
|
|
|
|
("SPC" org-agenda-show-and-scroll-up)
|
|
|
|
|
("<tab>" org-agenda-goto :exit t)
|
|
|
|
|
("TAB" org-agenda-goto :exit t)
|
|
|
|
|
("RET" org-agenda-switch-to :exit t)
|
|
|
|
|
("o" link-hint-open-link :exit t)
|
|
|
|
|
|
|
|
|
|
;; Date
|
|
|
|
|
("ds" org-agenda-schedule)
|
|
|
|
|
("dd" org-agenda-deadline)
|
|
|
|
|
("dt" org-agenda-date-prompt)
|
|
|
|
|
("+" org-agenda-do-date-later)
|
|
|
|
|
("-" org-agenda-do-date-earlier)
|
|
|
|
|
|
|
|
|
|
;; View
|
|
|
|
|
("vd" org-agenda-day-view)
|
|
|
|
|
("vw" org-agenda-week-view)
|
|
|
|
|
("vt" org-agenda-fortnight-view)
|
|
|
|
|
("vm" org-agenda-month-view)
|
|
|
|
|
("vy" org-agenda-year-view)
|
|
|
|
|
("vn" org-agenda-later)
|
|
|
|
|
("vp" org-agenda-earlier)
|
|
|
|
|
("vr" org-agenda-reset-view)
|
|
|
|
|
|
|
|
|
|
;; Toggle mode
|
|
|
|
|
("tf" org-agenda-follow-mode)
|
|
|
|
|
("tl" org-agenda-log-mode)
|
|
|
|
|
("ta" org-agenda-archives-mode)
|
|
|
|
|
("tr" org-agenda-clockreport-mode)
|
|
|
|
|
("td" org-agenda-toggle-diary)
|
|
|
|
|
|
|
|
|
|
;; Filter
|
|
|
|
|
("ft" org-agenda-filter-by-tag)
|
|
|
|
|
("fr" org-agenda-filter-by-tag-refine)
|
|
|
|
|
("fc" org-agenda-filter-by-category)
|
|
|
|
|
("fh" org-agenda-filter-by-top-headline)
|
|
|
|
|
("fx" org-agenda-filter-by-regexp)
|
|
|
|
|
("fd" org-agenda-filter-remove-all)
|
|
|
|
|
|
|
|
|
|
;; Clock
|
2016-09-25 00:47:44 +00:00
|
|
|
|
("cI" org-agenda-clock-in :exit t)
|
2016-02-20 14:30:18 +00:00
|
|
|
|
("cj" org-agenda-clock-goto :exit t)
|
2016-09-25 00:47:44 +00:00
|
|
|
|
("cO" org-agenda-clock-out)
|
|
|
|
|
("cq" org-agenda-clock-cancel)
|
2016-02-20 14:30:18 +00:00
|
|
|
|
|
|
|
|
|
;; Other
|
|
|
|
|
("q" nil :exit t)
|
|
|
|
|
("gr" org-agenda-redo)
|
|
|
|
|
("." org-agenda-goto-today)
|
|
|
|
|
("gd" org-agenda-goto-date)))
|
2015-11-17 18:52:20 +00:00
|
|
|
|
:config
|
|
|
|
|
(evilified-state-evilify-map org-agenda-mode-map
|
|
|
|
|
:mode org-agenda-mode
|
|
|
|
|
:bindings
|
|
|
|
|
"j" 'org-agenda-next-line
|
|
|
|
|
"k" 'org-agenda-previous-line
|
|
|
|
|
(kbd "M-j") 'org-agenda-next-item
|
|
|
|
|
(kbd "M-k") 'org-agenda-previous-item
|
|
|
|
|
(kbd "M-h") 'org-agenda-earlier
|
|
|
|
|
(kbd "M-l") 'org-agenda-later
|
|
|
|
|
(kbd "gd") 'org-agenda-toggle-time-grid
|
2016-01-08 09:33:50 +00:00
|
|
|
|
(kbd "gr") 'org-agenda-redo
|
|
|
|
|
(kbd "M-RET") 'org-agenda-show-and-scroll-up
|
2016-02-20 14:30:18 +00:00
|
|
|
|
(kbd "M-SPC") 'spacemacs/org-agenda-transient-state/body
|
|
|
|
|
(kbd "s-M-SPC") 'spacemacs/org-agenda-transient-state/body)))
|
2015-04-11 04:13:02 +00:00
|
|
|
|
|
2016-09-03 22:28:24 +00:00
|
|
|
|
(defun org/init-org-expiry ()
|
|
|
|
|
(use-package org-expiry
|
|
|
|
|
:commands (org-expiry-insinuate
|
|
|
|
|
org-expiry-deinsinuate
|
|
|
|
|
org-expiry-insert-created
|
|
|
|
|
org-expiry-insert-expiry
|
|
|
|
|
org-expiry-add-keyword
|
|
|
|
|
org-expiry-archive-subtree
|
|
|
|
|
org-expiry-process-entry
|
|
|
|
|
org-expiry-process-entries)))
|
|
|
|
|
|
2016-04-22 03:26:57 +00:00
|
|
|
|
(defun org/init-org-download ()
|
|
|
|
|
(use-package org-download
|
|
|
|
|
:commands (org-download-enable
|
|
|
|
|
org-download-yank
|
|
|
|
|
org-download-screenshot)
|
|
|
|
|
:init
|
|
|
|
|
(progn
|
|
|
|
|
(add-hook 'org-mode-hook 'org-download-enable)
|
2017-05-04 04:23:00 +00:00
|
|
|
|
(spacemacs/declare-prefix-for-mode 'org-mode "miD" "download")
|
2016-04-22 03:26:57 +00:00
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'org-mode
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"iDy" 'org-download-yank
|
|
|
|
|
"iDs" 'org-download-screenshot))))
|
2016-04-22 03:26:57 +00:00
|
|
|
|
|
2015-09-24 02:04:07 +00:00
|
|
|
|
(defun org/init-org-mime ()
|
|
|
|
|
(use-package org-mime
|
|
|
|
|
:defer t
|
|
|
|
|
:commands (org-mime-htmlize org-mime-org-buffer-htmlize)
|
|
|
|
|
:init
|
|
|
|
|
(progn
|
2017-05-04 04:23:00 +00:00
|
|
|
|
;; move this key bindings to an `init-message' function
|
2015-11-18 00:38:05 +00:00
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'message-mode
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"em" 'org-mime-htmlize)
|
2015-11-18 00:38:05 +00:00
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'org-mode
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"em" 'org-mime-org-buffer-htmlize))))
|
2015-09-24 02:04:07 +00:00
|
|
|
|
|
2015-04-11 14:44:07 +00:00
|
|
|
|
(defun org/init-org-pomodoro ()
|
2015-04-11 04:13:02 +00:00
|
|
|
|
(use-package org-pomodoro
|
|
|
|
|
:defer t
|
|
|
|
|
:init
|
|
|
|
|
(progn
|
2015-08-23 01:47:30 +00:00
|
|
|
|
(when (spacemacs/system-is-mac)
|
2015-04-11 04:13:02 +00:00
|
|
|
|
(setq org-pomodoro-audio-player "/usr/bin/afplay"))
|
2015-11-18 00:38:05 +00:00
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'org-mode
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"Cp" 'org-pomodoro)
|
2016-07-05 03:52:07 +00:00
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'org-agenda-mode
|
2017-05-04 04:23:00 +00:00
|
|
|
|
"Cp" 'org-pomodoro))))
|
2015-04-11 04:13:02 +00:00
|
|
|
|
|
2015-05-14 04:17:12 +00:00
|
|
|
|
(defun org/init-org-present ()
|
|
|
|
|
(use-package org-present
|
|
|
|
|
:defer t
|
|
|
|
|
:init
|
|
|
|
|
(progn
|
2015-11-21 10:07:14 +00:00
|
|
|
|
(evilified-state-evilify nil org-present-mode-keymap
|
|
|
|
|
"h" 'org-present-prev
|
|
|
|
|
"l" 'org-present-next
|
|
|
|
|
"q" 'org-present-quit)
|
2015-05-14 04:17:12 +00:00
|
|
|
|
(defun spacemacs//org-present-start ()
|
|
|
|
|
"Initiate `org-present' mode"
|
|
|
|
|
(org-present-big)
|
|
|
|
|
(org-display-inline-images)
|
|
|
|
|
(org-present-hide-cursor)
|
|
|
|
|
(org-present-read-only)
|
|
|
|
|
(evil-evilified-state))
|
|
|
|
|
(defun spacemacs//org-present-end ()
|
|
|
|
|
"Terminate `org-present' mode"
|
|
|
|
|
(org-present-small)
|
|
|
|
|
(org-remove-inline-images)
|
|
|
|
|
(org-present-show-cursor)
|
|
|
|
|
(org-present-read-write)
|
|
|
|
|
(evil-normal-state))
|
|
|
|
|
(add-hook 'org-present-mode-hook 'spacemacs//org-present-start)
|
|
|
|
|
(add-hook 'org-present-mode-quit-hook 'spacemacs//org-present-end))))
|
|
|
|
|
|
2016-06-14 09:35:54 +00:00
|
|
|
|
(defun org/init-org-projectile ()
|
|
|
|
|
(use-package org-projectile
|
|
|
|
|
:commands (org-projectile:location-for-project)
|
2015-04-11 04:13:02 +00:00
|
|
|
|
:init
|
|
|
|
|
(progn
|
2015-11-18 00:38:05 +00:00
|
|
|
|
(spacemacs/set-leader-keys
|
2016-06-14 09:35:54 +00:00
|
|
|
|
"aop" 'org-projectile/capture
|
2016-09-01 02:23:09 +00:00
|
|
|
|
"po" 'org-projectile/goto-todos)
|
2016-06-14 09:35:54 +00:00
|
|
|
|
(with-eval-after-load 'org-capture
|
|
|
|
|
(require 'org-projectile)))
|
2016-04-04 14:09:59 +00:00
|
|
|
|
:config
|
2016-06-14 09:35:54 +00:00
|
|
|
|
(if (file-name-absolute-p org-projectile-file)
|
|
|
|
|
(progn
|
|
|
|
|
(setq org-projectile:projects-file org-projectile-file)
|
|
|
|
|
(push (org-projectile:project-todo-entry
|
|
|
|
|
nil nil nil :empty-lines 1)
|
|
|
|
|
org-capture-templates))
|
|
|
|
|
(org-projectile:per-repo)
|
|
|
|
|
(setq org-projectile:per-repo-filename org-projectile-file))))
|
2015-04-13 06:01:49 +00:00
|
|
|
|
|
2016-09-24 01:06:57 +00:00
|
|
|
|
(defun org/init-ox-twbs ()
|
|
|
|
|
(spacemacs|use-package-add-hook org :post-config (require 'ox-twbs)))
|
|
|
|
|
|
2016-01-18 03:06:04 +00:00
|
|
|
|
(defun org/init-ox-gfm ()
|
2016-06-02 02:37:16 +00:00
|
|
|
|
(spacemacs|use-package-add-hook org :post-config (require 'ox-gfm)))
|
2016-06-02 02:07:24 +00:00
|
|
|
|
|
2016-06-02 02:05:46 +00:00
|
|
|
|
(defun org/init-ox-reveal ()
|
|
|
|
|
(spacemacs|use-package-add-hook org :post-config (require 'ox-reveal)))
|
2016-01-18 03:06:04 +00:00
|
|
|
|
|
2015-11-09 04:51:29 +00:00
|
|
|
|
(defun org/post-init-persp-mode ()
|
|
|
|
|
(spacemacs|define-custom-layout "@Org"
|
|
|
|
|
:binding "o"
|
|
|
|
|
:body
|
2016-08-07 19:04:04 +00:00
|
|
|
|
(let ((agenda-files (org-agenda-files)))
|
2016-08-07 19:05:31 +00:00
|
|
|
|
(if agenda-files
|
|
|
|
|
(find-file (first agenda-files))
|
|
|
|
|
(user-error "Error: No agenda files configured, nothing to display.")))))
|
2016-09-07 03:10:13 +00:00
|
|
|
|
|
|
|
|
|
(defun org/init-org-journal ()
|
|
|
|
|
(use-package org-journal
|
|
|
|
|
:defer t
|
2016-12-14 18:06:24 +00:00
|
|
|
|
:commands (org-journal-new-entry org-journal-search-forever)
|
2016-09-07 03:10:13 +00:00
|
|
|
|
:init
|
|
|
|
|
(progn
|
2016-12-14 18:06:24 +00:00
|
|
|
|
(spacemacs/declare-prefix "aoj" "org-journal")
|
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
|
"aojj" 'org-journal-new-entry
|
|
|
|
|
"aojs" 'org-journal-search-forever)
|
2016-09-07 03:10:13 +00:00
|
|
|
|
|
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'calendar-mode
|
|
|
|
|
"r" 'org-journal-read-entry
|
|
|
|
|
"i" 'org-journal-new-date-entry
|
2016-12-14 18:06:24 +00:00
|
|
|
|
"n" 'org-journal-next-entry
|
|
|
|
|
"p" 'org-journal-previous-entry
|
|
|
|
|
"s" 'org-journal-search-forever
|
|
|
|
|
"w" 'org-journal-search-calendar-week
|
|
|
|
|
"m" 'org-journal-search-calendar-month
|
|
|
|
|
"y" 'org-journal-search-calendar-year)
|
2016-09-07 03:10:13 +00:00
|
|
|
|
|
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'org-journal-mode
|
|
|
|
|
"j" 'org-journal-new-entry
|
|
|
|
|
"n" 'org-journal-open-next-entry
|
|
|
|
|
"p" 'org-journal-open-previous-entry))))
|