2019-12-19 17:29:36 -05:00
|
|
|
;;; lang/org/contrib/brain.el -*- lexical-binding: t; -*-
|
|
|
|
;;;###if (featurep! +brain)
|
|
|
|
|
|
|
|
(use-package! org-brain
|
|
|
|
:defer t
|
|
|
|
:init
|
2019-12-29 16:31:25 -05:00
|
|
|
(setq org-brain-visualize-default-choices 'all
|
2019-12-19 17:29:36 -05:00
|
|
|
org-brain-title-max-length 24
|
|
|
|
org-brain-include-file-entries nil
|
|
|
|
org-brain-file-entries-use-title nil)
|
|
|
|
|
|
|
|
:config
|
2021-04-14 18:00:21 -04:00
|
|
|
(set-popup-rule! "^\\*org-brain"
|
|
|
|
:side 'right :size 1.00 :select t :quit nil :ttl nil)
|
2019-12-19 17:29:36 -05:00
|
|
|
|
|
|
|
(cl-pushnew '("b" "Brain" plain (function org-brain-goto-end)
|
|
|
|
"* %i%?" :empty-lines 1)
|
|
|
|
org-capture-templates
|
2021-04-14 18:00:21 -04:00
|
|
|
:key #'car :test #'equal)
|
|
|
|
|
|
|
|
(when (featurep! :editor evil +everywhere)
|
|
|
|
;; TODO Make a proper evil keybind scheme for org-brain
|
|
|
|
;; REVIEW This should be handled upstream by evil-collection
|
|
|
|
(set-evil-initial-state!
|
|
|
|
'(org-brain-visualize-mode
|
|
|
|
org-brain-select-map
|
|
|
|
org-brain-move-map
|
|
|
|
org-brain-polymode-map)
|
|
|
|
'normal)
|
|
|
|
(defun +org--evilify-map (map)
|
|
|
|
(let (keys)
|
|
|
|
(map-keymap (lambda (event function)
|
|
|
|
(push function keys)
|
2021-05-27 03:53:43 -04:00
|
|
|
(push (vector event) keys))
|
2021-04-14 18:00:21 -04:00
|
|
|
map)
|
|
|
|
(apply #'evil-define-key* 'normal map keys)))
|
|
|
|
|
|
|
|
(+org--evilify-map org-brain-visualize-mode-map)
|
|
|
|
(+org--evilify-map org-brain-select-map)
|
|
|
|
(+org--evilify-map org-brain-move-map)
|
2021-05-27 12:54:06 -04:00
|
|
|
(after! polymode
|
|
|
|
(+org--evilify-map org-brain-polymode-map))))
|