mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-02 14:53:38 -05:00
Move modules/org/* back to lang/org
This commit is contained in:
37
modules/lang/org/+capture.el
Normal file
37
modules/lang/org/+capture.el
Normal file
@@ -0,0 +1,37 @@
|
||||
;;; lang/org/+capture.el -*- lexical-binding: t; -*-
|
||||
|
||||
(add-hook 'org-load-hook #'+org-capture|init)
|
||||
|
||||
;; Sets up two `org-capture' workflows that I like:
|
||||
;;
|
||||
;; 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
|
||||
;; script is in ~/.emacs.d/bin). This lets me open an org-capture box
|
||||
;; anywhere I can call org-capture (whether or not Emacs is open/running),
|
||||
;; like, say, from qutebrowser, vimperator, dmenu or a global keybinding.
|
||||
|
||||
(defvar +org-default-notes-file "notes.org"
|
||||
"TODO")
|
||||
|
||||
(setq 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)))
|
||||
|
||||
(defun +org-capture|init ()
|
||||
(defvaralias 'org-default-notes-file '+org-default-notes-file)
|
||||
(setq org-default-notes-file (expand-file-name +org-default-notes-file +org-dir))
|
||||
|
||||
(add-hook 'org-capture-after-finalize-hook #'+org-capture|cleanup-frame)
|
||||
|
||||
(when (featurep! :feature evil)
|
||||
(add-hook 'org-capture-mode-hook #'evil-insert-state))
|
||||
|
||||
(when (featurep! :ui doom-dashboard)
|
||||
(add-hook '+doom-dashboard-inhibit-functions #'+org-capture-frame-p)))
|
Reference in New Issue
Block a user