2015-04-11 04:13:02 +00:00
|
|
|
;;; packages.el --- Org Layer packages File for Spacemacs
|
|
|
|
;;
|
|
|
|
;; Copyright (c) 2012-2014 Sylvain Benner
|
|
|
|
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
|
|
|
|
;;
|
|
|
|
;; 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
|
|
|
'(
|
|
|
|
evil-org
|
|
|
|
org
|
|
|
|
org-bullets
|
|
|
|
org-pomodoro
|
2015-05-14 04:17:12 +00:00
|
|
|
org-present
|
2015-04-11 04:13:02 +00:00
|
|
|
org-repo-todo
|
2015-04-13 06:01:49 +00:00
|
|
|
ox-gfm
|
2015-04-21 05:50:21 +00:00
|
|
|
htmlize
|
2015-04-19 03:40:24 +00:00
|
|
|
))
|
2015-04-11 04:13:02 +00:00
|
|
|
|
2015-04-19 03:40:24 +00:00
|
|
|
(setq org-excluded-packages
|
2015-04-13 07:38:01 +00:00
|
|
|
'(
|
|
|
|
;; seems to be problematic, to investigate
|
|
|
|
ox-gfm
|
2015-04-19 03:40:24 +00:00
|
|
|
))
|
2015-04-13 07:38:01 +00:00
|
|
|
|
2015-04-11 04:13:02 +00:00
|
|
|
(defun org/init-evil-org ()
|
|
|
|
(use-package evil-org
|
|
|
|
:commands evil-org-mode
|
|
|
|
:init
|
|
|
|
(add-hook 'org-mode-hook 'evil-org-mode)
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(evil-leader/set-key-for-mode 'org-mode
|
|
|
|
"a" nil "ma" 'org-agenda
|
|
|
|
"c" nil "mA" 'org-archive-subtree
|
|
|
|
"o" nil "mC" 'evil-org-recompute-clocks
|
2015-04-14 20:36:02 +00:00
|
|
|
"l" nil "mo" 'evil-org-open-links
|
2015-04-13 08:09:50 +00:00
|
|
|
"t" nil "mT" 'org-show-todo-tree)
|
|
|
|
(evil-define-key 'normal evil-org-mode-map
|
2015-05-08 03:06:38 +00:00
|
|
|
"O" 'evil-open-above)
|
2015-04-11 04:13:02 +00:00
|
|
|
(spacemacs|diminish evil-org-mode " ⓔ" " e"))))
|
|
|
|
|
|
|
|
(defun org/init-org ()
|
|
|
|
(use-package org
|
|
|
|
:mode ("\\.org$" . org-mode)
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq org-log-done t)
|
2015-04-11 04:38:31 +00:00
|
|
|
|
|
|
|
(eval-after-load 'org-indent
|
|
|
|
'(spacemacs|hide-lighter org-indent-mode))
|
2015-04-15 21:24:55 +00:00
|
|
|
(setq org-startup-indented t)
|
2015-04-23 23:28:24 +00:00
|
|
|
(setq org-export-async-init-file (concat user-emacs-directory "contrib/org/org-async-init.el"))
|
2015-04-11 04:38:31 +00:00
|
|
|
|
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-04-11 04:13:02 +00:00
|
|
|
(evil-leader/set-key-for-mode 'org-mode
|
2015-05-08 03:06:38 +00:00
|
|
|
"m'" 'org-edit-special
|
2015-04-11 04:13:02 +00:00
|
|
|
"mc" 'org-capture
|
|
|
|
"md" 'org-deadline
|
|
|
|
"me" 'org-export-dispatch
|
|
|
|
"mf" 'org-set-effort
|
2015-05-08 03:06:38 +00:00
|
|
|
|
|
|
|
;; headings
|
|
|
|
"mhi" 'org-insert-heading-after-current
|
|
|
|
"mhI" 'org-insert-heading
|
|
|
|
|
2015-04-13 08:09:50 +00:00
|
|
|
"mI" 'org-clock-in
|
2015-04-20 00:09:51 +00:00
|
|
|
"mj" 'helm-org-in-buffer-headings
|
2015-05-10 18:29:52 +00:00
|
|
|
(if dotspacemacs-major-mode-leader-key
|
|
|
|
(concat "m" dotspacemacs-major-mode-leader-key)
|
|
|
|
"m,") 'org-ctrl-c-ctrl-c
|
|
|
|
"mn" 'org-narrow-to-subtree
|
|
|
|
"mN" 'widen
|
|
|
|
"mO" 'org-clock-out
|
|
|
|
"mq" 'org-clock-cancel
|
|
|
|
"mR" 'org-refile
|
|
|
|
"ms" 'org-schedule
|
2015-05-08 03:06:38 +00:00
|
|
|
|
2015-05-10 18:29:52 +00:00
|
|
|
;; insertion of common elements
|
|
|
|
"mil" 'org-insert-link
|
|
|
|
"mif" 'org-footnote-new
|
2015-05-08 03:06:38 +00:00
|
|
|
|
2015-05-10 18:29:52 +00:00
|
|
|
;; images and other link types have no commands in org mode-line
|
|
|
|
;; could be inserted using yasnippet?
|
|
|
|
;; region manipulation
|
|
|
|
"mxb" (spacemacs|org-emphasize spacemacs/org-bold ?*)
|
|
|
|
"mxc" (spacemacs|org-emphasize spacemacs/org-code ?~)
|
|
|
|
"mxi" (spacemacs|org-emphasize spacemacs/org-italic ?/)
|
|
|
|
"mxr" (spacemacs|org-emphasize spacemacs/org-clear ? )
|
|
|
|
"mxs" (spacemacs|org-emphasize spacemacs/org-strike-through ?+)
|
|
|
|
"mxu" (spacemacs|org-emphasize spacemacs/org-underline ?_)
|
|
|
|
"mxv" (spacemacs|org-emphasize spacemacs/org-verbose ?=))
|
2015-04-11 04:13:02 +00:00
|
|
|
|
|
|
|
(eval-after-load "org-agenda"
|
|
|
|
'(progn
|
|
|
|
(define-key org-agenda-mode-map "j" 'org-agenda-next-line)
|
|
|
|
(define-key org-agenda-mode-map "k" 'org-agenda-previous-line)
|
2015-04-15 15:33:41 +00:00
|
|
|
;; Since we override SPC, let's make RET do that functionality
|
|
|
|
(define-key org-agenda-mode-map
|
|
|
|
(kbd "RET") 'org-agenda-show-and-scroll-up)
|
2015-04-11 04:13:02 +00:00
|
|
|
(define-key org-agenda-mode-map
|
|
|
|
(kbd "SPC") evil-leader--default-map))))
|
|
|
|
:config
|
|
|
|
(progn
|
2015-04-13 06:01:49 +00:00
|
|
|
(require 'org-indent)
|
2015-04-11 04:13:02 +00:00
|
|
|
(define-key global-map "\C-cl" 'org-store-link)
|
2015-04-13 08:09:50 +00:00
|
|
|
(define-key global-map "\C-ca" 'org-agenda)
|
|
|
|
(evil-leader/set-key
|
2015-05-08 03:06:38 +00:00
|
|
|
"Cc" 'org-capture))))
|
2015-04-11 04:13:02 +00:00
|
|
|
|
|
|
|
(defun org/init-org-bullets ()
|
|
|
|
(use-package org-bullets
|
|
|
|
:defer t
|
|
|
|
:init (add-hook 'org-mode-hook 'org-bullets-mode)))
|
|
|
|
|
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
|
|
|
|
(when (system-is-mac)
|
|
|
|
(setq org-pomodoro-audio-player "/usr/bin/afplay"))
|
|
|
|
(evil-leader/set-key-for-mode 'org-mode
|
|
|
|
"mp" 'org-pomodoro))))
|
|
|
|
|
2015-05-14 04:17:12 +00:00
|
|
|
(defun org/init-org-present ()
|
|
|
|
(use-package org-present
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(evilify nil org-present-mode-keymap
|
|
|
|
"h" 'org-present-prev
|
|
|
|
"l" 'org-present-next
|
|
|
|
"q" 'org-present-quit)
|
|
|
|
(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))))
|
|
|
|
|
|
|
|
|
2015-04-11 04:13:02 +00:00
|
|
|
(defun org/init-org-repo-todo ()
|
|
|
|
(use-package org-repo-todo
|
|
|
|
:commands (ort/capture-todo
|
|
|
|
ort/capture-todo-check
|
|
|
|
ort/goto-todos)
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(evil-leader/set-key
|
|
|
|
"Ct" 'ort/capture-todo
|
|
|
|
"CT" 'ort/capture-todo-check)
|
|
|
|
(evil-leader/set-key-for-mode 'org-mode
|
|
|
|
"mgt" 'ort/goto-todos))))
|
2015-04-13 06:01:49 +00:00
|
|
|
|
|
|
|
(defun org/init-ox-gfm ()
|
|
|
|
(use-package ox-gfm
|
|
|
|
:defer t))
|
2015-04-21 05:50:21 +00:00
|
|
|
|
|
|
|
(defun org/init-htmlize ()
|
|
|
|
(use-package htmlize
|
|
|
|
:defer t))
|