diff options
author | Guangxiong Lin <[email protected]> | 2022-03-12 12:41:32 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-03-12 12:41:32 +0800 |
commit | 46bc67bb1b5a718f4dd152871b88f8ece60ae373 (patch) | |
tree | 2cb725be11a6c789b92bf7a0b7b8c9b14e04b58f /.emacs.d/lisp | |
parent | 7d1dbb644eed690bb348ec8d0cdd62350c112a35 (diff) | |
download | dotfiles-46bc67bb1b5a718f4dd152871b88f8ece60ae373.tar.gz dotfiles-46bc67bb1b5a718f4dd152871b88f8ece60ae373.tar.bz2 dotfiles-46bc67bb1b5a718f4dd152871b88f8ece60ae373.zip |
Improve org-agenda view (emacs)
Diffstat (limited to '.emacs.d/lisp')
-rw-r--r-- | .emacs.d/lisp/init-org.el | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/.emacs.d/lisp/init-org.el b/.emacs.d/lisp/init-org.el index 2c6c7ee..1840d7d 100644 --- a/.emacs.d/lisp/init-org.el +++ b/.emacs.d/lisp/init-org.el @@ -43,6 +43,7 @@ (setq org-clock-persist 'history) (org-clock-persistence-insinuate) + (setq org-tags-column (- fill-column)) ;; refile (setq org-refile-targets '((nil :maxlevel . 9) @@ -66,7 +67,7 @@ (setq org-tag-alist '((:startgroup . nil) ("@work" . ?w) ("@home" . ?h) ("errants" . ?e) (:endgroup . nil) - ("phone" . ?p) + ("phone" . ?m) ("FLAGGED" . ?f) ("URGENT" . ?u) ("PROJECT" . ?p))) @@ -80,9 +81,21 @@ ;; org-habit (add-to-list 'org-modules 'org-habit t)) +(use-package org-ql + :ensure t + :after (org) + :init + (defun my-org-agenda-block--stuck-projects (&rest args) + "A block showing stuck projects." + (setq org-ql-block-header "Stuck Projects") + (org-ql-block '(and (tags "PROJECT") + (not (or (done) (todo "SOMEDAY"))) + (not (descendants (todo "NEXT"))) + (not (descendants (scheduled))))))) + (use-package org-agenda :ensure nil - :after (org) + :after (org org-ql) :commands (org-agenda) :init (setq org-agenda-dim-blocked-tasks nil) @@ -94,19 +107,23 @@ ;; (tags . "%i %-12:c") ;; (search . " %i %-12:c"))) + (setq org-agenda-tags-column org-tags-column) (setq org-deadline-warning-days 30) (setq org-agenda-compact-blocks t) + (setq org-agenda-custom-commands '(("D" "Daily agenda and all TODOs" ((agenda "" ((org-agenda-span 1))) (tags-todo "+PRIORITY=\"A\"") (tags-todo "computer|@office|phone") (tags "PROJECT+CATEGORY=\"elephants\"") + (my-org-agenda-block--stuck-projects) + (todo "NEXT") (todo "WAITING")) ((org-agenda-compact-blocks t))) ("W" "Weekly Review" ((agenda "" ((org-agenda-ndays-to-span 7))) - (stuck "") ; review stuck porjects as designated by org-stuck-projects + (my-org-agenda-block--stuck-projects) (todo "NEXT") (todo "WAITING"))) ("d" "Upcoming deadlines" agenda "" @@ -147,6 +164,8 @@ (evil-define-key 'normal 'global (kbd "<leader>fn") 'org-roam-node-find (kbd "<leader>cn") 'org-roam-dailies-goto-today) + (evil-define-key 'normal 'org-roam-mode-map + (kbd "<leader>oin") 'org-roam-node-insert) :config (setq org-roam-db-gc-threshold most-positive-fixnum) (setq org-roam-dailies-directory "journals/") |