2017-12-08 22:59:42 -05:00
|
|
|
;;; lang/org/+capture.el -*- lexical-binding: t; -*-
|
2017-07-05 02:33:41 +02:00
|
|
|
|
2017-02-24 20:00:59 -05:00
|
|
|
;; Sets up two `org-capture' workflows that I like:
|
2017-02-19 19:01:47 -05:00
|
|
|
;;
|
2017-02-24 20:00:59 -05:00
|
|
|
;; 1. The traditional way: invoking `org-capture' directly (or through a
|
|
|
|
;; command, like :org).
|
|
|
|
;;
|
|
|
|
;; 2. Through a org-capture popup frame that is invoked from outside Emacs (the
|
2017-04-22 01:51:52 -04:00
|
|
|
;; script is in ~/.emacs.d/bin). This lets me open an org-capture box
|
2017-07-05 02:33:41 +02:00
|
|
|
;; anywhere I can call org-capture (whether or not Emacs is open/running),
|
|
|
|
;; like, say, from qutebrowser, vimperator, dmenu or a global keybinding.
|
2017-02-19 19:01:47 -05:00
|
|
|
|
2017-12-08 22:59:42 -05:00
|
|
|
(defvar +org-default-notes-file "notes.org"
|
|
|
|
"TODO")
|
|
|
|
|
2017-12-16 12:50:34 -05:00
|
|
|
(defvar org-capture-templates
|
|
|
|
'(("t" "Todo" entry
|
|
|
|
(file+headline (expand-file-name "todo.org" +org-dir) "Inbox")
|
|
|
|
"* [ ] %?\n%i" :prepend t :kill-buffer t)
|
|
|
|
|
|
|
|
("n" "Notes" entry
|
|
|
|
(file+headline org-default-notes-file "Inbox")
|
|
|
|
"* %u %?\n%i" :prepend t :kill-buffer t)))
|
2017-02-24 20:00:59 -05:00
|
|
|
|
2017-07-05 03:09:43 +02:00
|
|
|
|
2017-12-09 14:42:42 -05:00
|
|
|
(after! org
|
2017-12-08 22:59:42 -05:00
|
|
|
(defvaralias 'org-default-notes-file '+org-default-notes-file)
|
2017-12-16 12:50:34 -05:00
|
|
|
|
2017-12-08 22:59:42 -05:00
|
|
|
(setq org-default-notes-file (expand-file-name +org-default-notes-file +org-dir))
|
|
|
|
|
2017-10-02 20:00:01 +02:00
|
|
|
(add-hook 'org-capture-after-finalize-hook #'+org-capture|cleanup-frame)
|
|
|
|
|
|
|
|
(when (featurep! :feature evil)
|
|
|
|
(add-hook 'org-capture-mode-hook #'evil-insert-state))
|
2017-02-24 20:00:59 -05:00
|
|
|
|
2017-10-02 20:00:01 +02:00
|
|
|
(when (featurep! :ui doom-dashboard)
|
|
|
|
(add-hook '+doom-dashboard-inhibit-functions #'+org-capture-frame-p)))
|