tie origami to org super agenda and auto-hide some low-priority groupings by default
This commit is contained in:
parent
f989fbeedf
commit
b7287c50f8
|
@ -126,10 +126,12 @@
|
|||
; origami config
|
||||
(use-package origami
|
||||
:demand
|
||||
|
||||
:config
|
||||
(define-prefix-command 'origami-mode-map)
|
||||
(define-key ctl-x-map (kbd "z") 'origami-mode-map)
|
||||
(global-origami-mode)
|
||||
|
||||
:bind
|
||||
(:map origami-mode-map
|
||||
("o" . origami-open-node)
|
||||
|
|
17
org/init.el
17
org/init.el
|
@ -177,3 +177,20 @@
|
|||
persp-add-buffer-on-after-change-major-mode)
|
||||
:hooks '(after-switch-to-buffer-functions)
|
||||
:switch 'window)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; origami + super agenda config
|
||||
(defvar ap/org-super-agenda-auto-hide-groups
|
||||
'("Slip Box" "Low Priority"))
|
||||
|
||||
(defun ap/org-super-agenda-origami-fold-default ()
|
||||
"Fold certain groups by default in Org Super Agenda buffer."
|
||||
(forward-line 3)
|
||||
(--each ap/org-super-agenda-auto-hide-groups
|
||||
(goto-char (point-min))
|
||||
(cl-loop do (origami-close-node (current-buffer) (point))
|
||||
while (re-search-forward (rx-to-string `(seq bol " " ,it)) nil t))))
|
||||
|
||||
(add-hook 'org-agenda-mode-hook #'origami-mode)
|
||||
|
||||
(add-hook 'org-agenda-finalize-hook #'ap/org-super-agenda-origami-fold-default)
|
||||
|
|
Reference in a new issue