Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Sameer Rahmani | e21c5b47d1 |
|
@ -29,6 +29,14 @@
|
||||||
(require 'fg42/cube)
|
(require 'fg42/cube)
|
||||||
|
|
||||||
|
|
||||||
|
(defflag org-journal
|
||||||
|
"Enable the support for org-journal in FG42." t)
|
||||||
|
|
||||||
|
|
||||||
|
(defvar fg42/default-org-journal-heder
|
||||||
|
"#+TITLE: Yearly Journal
|
||||||
|
#+STARTUP: folded logdrawer logdone logreschedule indent content align constSI entitiespretty")
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/org-ql-cube
|
(defcube fg42/org-ql-cube
|
||||||
"This package provides a query language for Org files. It offers two
|
"This package provides a query language for Org files. It offers two
|
||||||
|
@ -142,7 +150,11 @@ For more info on ~org-mode~ check out [[https://orgmode.org/]]"
|
||||||
(let ((capture-key (or (plist-get fg42/org-cube-params :capture-key)
|
(let ((capture-key (or (plist-get fg42/org-cube-params :capture-key)
|
||||||
(kbd "<f6>")))
|
(kbd "<f6>")))
|
||||||
(org-home (or (plist-get fg42/org-cube-params :org-home) "~/orgs"))
|
(org-home (or (plist-get fg42/org-cube-params :org-home) "~/orgs"))
|
||||||
(notes-file (or (plist-get fg42/org-cube-params :org-home) "~/orgs/notes.org")))
|
(notes-file (or (plist-get fg42/org-cube-params :org-home) "~/orgs/notes.org"))
|
||||||
|
(journal-header (or (plist-get fg42/org-cube-params :journal-header) fg42/default-org-journal-heder))
|
||||||
|
(journal-type (or (plist-get fg42/org-cube-params :journal-type) 'yearly))
|
||||||
|
(global-tags (plist-get fg42/org-cube-params :global-tags))
|
||||||
|
(agenda-files (or (plist-get fg42/org-cube-params :agenda-files) '("~/orgs/main.org"))))
|
||||||
|
|
||||||
(fpkg/use org-bullets
|
(fpkg/use org-bullets
|
||||||
:hook (org-mode . org-bullets-mode))
|
:hook (org-mode . org-bullets-mode))
|
||||||
|
@ -151,12 +163,36 @@ For more info on ~org-mode~ check out [[https://orgmode.org/]]"
|
||||||
(fg42/org-ql-cube)
|
(fg42/org-ql-cube)
|
||||||
(fg42/org-sidebar)
|
(fg42/org-sidebar)
|
||||||
|
|
||||||
|
(when-flag org-journal
|
||||||
|
;; This function will handle the org-capture integration only if org-journal
|
||||||
|
;; flag is set
|
||||||
|
(defun fg42/org-journal-find-location ()
|
||||||
|
;; Open today's journal, but specify a non-nil prefix argument in order to
|
||||||
|
;; inhibit inserting the heading; org-capture will insert the heading.
|
||||||
|
(org-journal-new-entry t)
|
||||||
|
(unless (eq org-journal-file-type 'daily)
|
||||||
|
(org-narrow-to-subtree))
|
||||||
|
(goto-char (point-max)))
|
||||||
|
|
||||||
|
(fpkg/use org-journal
|
||||||
|
:defer t
|
||||||
|
:init
|
||||||
|
;; Change default prefix key; needs to be set before loading org-journal
|
||||||
|
(setq org-journal-prefix-key "C-c j ")
|
||||||
|
:config
|
||||||
|
(setq org-journal-file-type journal-type
|
||||||
|
org-journal-file-header journal-header
|
||||||
|
org-journal-dir (expand-file-name "journal" org-home)
|
||||||
|
org-journal-date-format "%Y-%m-%d (%A): ")))
|
||||||
|
|
||||||
|
|
||||||
(fpkg/use org-mode
|
(fpkg/use org-mode
|
||||||
:init
|
:init
|
||||||
(progn
|
(progn
|
||||||
(require 'org-capture)
|
(require 'org-capture)
|
||||||
(global-set-key capture-key 'org-capture)
|
(global-set-key capture-key 'org-capture)
|
||||||
|
(setq org-tag-alist global-tags)
|
||||||
|
(setq org-agenda-files agenda-files)
|
||||||
(setq org-directory org-home)
|
(setq org-directory org-home)
|
||||||
(setq org-default-notes-file notes-file)
|
(setq org-default-notes-file notes-file)
|
||||||
(setq org-capture-templates
|
(setq org-capture-templates
|
||||||
|
@ -168,7 +204,14 @@ For more info on ~org-mode~ check out [[https://orgmode.org/]]"
|
||||||
'("l" "Link" entry (file+headline ,(expand-file-name "bookmarks.org" org-home) "Links")
|
'("l" "Link" entry (file+headline ,(expand-file-name "bookmarks.org" org-home) "Links")
|
||||||
(file ,(expand-file-name "templates/links" org-home))
|
(file ,(expand-file-name "templates/links" org-home))
|
||||||
:prepend t
|
:prepend t
|
||||||
|
:immediate-finish t
|
||||||
:empty-lines 1)
|
:empty-lines 1)
|
||||||
|
,@(when-flag org-journal
|
||||||
|
'((quote ("j" "Journal Entry" plain #'fg42/org-journal-find-location
|
||||||
|
"** %(format-time-string org-journal-time-format)%^{Title} %^G\n %?\n\n*** Context:\n %i\n From: %a"
|
||||||
|
:jump-to-captured t
|
||||||
|
:immediate-finish nil))))
|
||||||
|
|
||||||
'("h" "Thoughts" entry (file+datetree ,(expand-file-name "journal.org" org-home))
|
'("h" "Thoughts" entry (file+datetree ,(expand-file-name "journal.org" org-home))
|
||||||
(file ,(expand-file-name "templates/thoughts" org-home))))))
|
(file ,(expand-file-name "templates/thoughts" org-home))))))
|
||||||
(setq org-refile-targets '((org-agenda-files :maxlevel . 3)))
|
(setq org-refile-targets '((org-agenda-files :maxlevel . 3)))
|
||||||
|
|
Loading…
Reference in New Issue