dotfiles

feels like ${HOME}
Log | Files | Refs | README

+org.el (6392B)


      1 ;;; ~/.doom.d/+org.el -*- lexical-binding: t; -*-
      2 
      3 ;; source https://github.com/theianjones/dotfiles/blob/master/.doom.d/+org.el
      4 
      5 (use-package! org-roam
      6   :hook
      7   (after-init . org-roam-mode))
      8   (setq org_notes "~/Library/Mobile Documents/iCloud~com~appsonthemove~beorg/Documents/org/")
      9 
     10 (after! org-roam
     11   (add-hook 'after-init-hook 'org-roam-mode)
     12   :config
     13   (setq org-roam-directory org_notes)
     14   (setq org-roam-db-location "~/org/org-roam.db")
     15   (setq org-roam-link-title-format "[[%s]]")
     16   (setq org-roam-graph-viewer "/usr/bin/open")
     17   (setq org-roam-capture-ref-templates
     18         '(("r" "ref" plain (function org-roam-capture--get-point)
     19            "%?"
     20            :file-name "${slug}"
     21            :head "#+title: ${title}
     22 #+author: ${author}
     23 #+roam_key: ${ref}
     24 #+roam_tags: web_references
     25 - saved :: ${savedDate}
     26 - source :: ${ref}
     27 
     28 * Highlights\n"
     29            :immediate-finish t
     30            :unnarrowed t
     31            :config
     32            (add-hook! 'after-init-hook 'org-roam-db-build-cache)))))
     33 
     34   (setq org-roam-dailies-capture-templates
     35     '(("d" "daily" plain (function org-roam-capture--get-point)
     36       "%?"
     37       :file-name "%<%Y-%m-%d>"
     38       :immediate-finish t
     39       :head "#+title: %<%A>, %<%d> %<%B> %<%Y>
     40 #+roam_tags: journals\n
     41 \n
     42 * %<%A>, %<%d> %<%B> %<%Y>"
     43       :unnarrowed t)))
     44 
     45   (setq org-roam-capture-templates
     46         '(("d" "default" plain (function org-roam-capture--get-point)
     47            "%?"
     48            :file-name "%<%Y%m%d%H%M%S>-${slug}"
     49            :head "#+title: ${title}\n"
     50            :immediate-finish t
     51            :unnarrowed t)
     52           ("k" "kumparan" plain (function org-roam-capture--get-point)
     53            "%?"
     54            :file-name "%<%Y%m%d%H%M%S>-${slug}"
     55            :head "#+title: ${title}
     56 #+roam_tags: kumparan
     57 - backlinks :: [[file:20200630143644-kumparan.org][kumparan]]"
     58            :immediate-finish t
     59            :unnarrowed t)
     60           ("c" "companies" plain (function org-roam-capture--get-point)
     61            "%?"
     62            :file-name "%<%Y%m%d%H%M%S>-${slug}"
     63            :head "#+title: ${title}
     64 #+roam_tags: companies\n"
     65            :immediate-finish t
     66            :unnarrowed t)
     67           ("m" "medias" plain (function org-roam-capture--get-point)
     68            "%?"
     69            :file-name "%<%Y%m%d%H%M%S>-${slug}"
     70            :head "#+title: ${title}
     71 #+roam_tags: medias\n"
     72            :immediate-finish t
     73            :unnarrowed t)
     74           ("p" "products" plain (function org-roam-capture--get-point)
     75            "%?"
     76            :file-name "%<%Y%m%d%H%M%S>-${slug}"
     77            :head "#+title: ${title}
     78 #+roam_tags: products\n"
     79            :immediate-finish t
     80            :unnarrowed t)
     81           ("i" "people" plain (function org-roam-capture--get-point)
     82            "%?"
     83            :file-name "%<%Y%m%d%H%M%S>-${slug}"
     84            :head "#+title: ${title}
     85 #+roam_tags: people\n"
     86            :immediate-finish t
     87            :unnarrowed t)))
     88 
     89 (use-package! deft
     90   :after org
     91   :config
     92   (setq deft-recursive t)
     93   (setq deft-use-filter-string-for-filename t)
     94   (setq deft-default-extension "org")
     95   (setq deft-incremental-search t)
     96   (setq deft-directory org_notes)
     97   (add-hook 'after-init-hook 'org-roam-db-build-cache)
     98   :bind
     99   ("s-d" . deft))
    100 
    101 (use-package! org-journal
    102   :bind
    103   ("C-c n j" . org-journal-new-entry)
    104   ("C-c b" . org-journal-previous-entry)
    105   ("C-c f" . org-journal-next-entry)
    106   :config
    107   (setq org-journal-dir org_notes
    108         org-journal-date-prefix "#+title: "
    109         org-journal-file-format "%Y-%m-%d.org"
    110         org-journal-date-format "%A, %d %B %Y\n#+roam_tags: journals\n\n* %A, %d %B %Y\n"))
    111 
    112 (after! org
    113   :init
    114   (require 'find-lisp)
    115   (setq org-agenda-files (find-lisp-find-files org_notes "\.org$"))
    116   (setq org-agenda-start-with-log-mode '(state))
    117   (setq org-agenda-start-day "-9d")
    118   (map! :map org-mode-map
    119         :n "M-j" #'org-metadown
    120         :n "M-k" #'orge-metaup)
    121   :config
    122   (setq org-directory org_notes
    123         org-ellipsis " ▼ "
    124         org-id-link-to-org-use-id nil
    125         org-pretty-entities t
    126         org-log-done 'note
    127         org-log-into-drawer t
    128         org-log-refile t
    129         org-src-fontify-natively t
    130         org-hide-emphasis-markers t)
    131   (setq org-todo-keywords
    132         '((sequence "TODO(t!)" "INPROGRESS(p!)" "INTEST(i!)" "FEEDBACK(f!)" "HOLD(h!)" "|" "MERGED(m!)" "DONE(d@/!)" "CANCELLED(c!)")
    133           (sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)")))
    134   (setq org-todo-keyword-faces
    135         '(("TODO" :foreground "ffff00" :weight normal :underline t)
    136           ("INPROGRESS" :foreground "#e39ff6" :weight normal :underline t)
    137           ("INTEST" :foreground "#0098dd" :weight normal :underline t)
    138           ("FEEDBACK" :foreground "#0098ee" :weight normal :underline t)
    139           ("HOLD" :foreground "#9f7efe" :weight normal :underline t)
    140           ("MERGED" :foreground "#50a14f" :weight normal :underline t)
    141           ("DONE" :foreground "#50a14f" :weight bold :underline t)
    142           ("CANCELLED" :foreground "#ff6480" :weight normal :underline t)
    143           ("[-]" :foreground "#e39ff6" :weight bold)
    144           ("[?]" :foreground "#9f7efe" :weight bold))))
    145 
    146 (use-package! org-roam-server
    147   :config
    148   (setq org-roam-server-host "127.0.0.1"
    149         org-roam-server-port 3001
    150         org-roam-server-export-inline-images t
    151         org-roam-server-authenticate nil
    152         org-roam-server-network-poll t
    153         org-roam-server-network-arrows nil
    154         org-roam-server-network-label-truncate t
    155         org-roam-server-network-label-truncate-length 60
    156         org-roam-server-network-label-wrap-length 20))
    157 
    158 ;; (add-hook 'org-roam-server-mode (lambda () (browse-url-chrome "http://localhost:3001")))
    159 
    160 ;; Refile a heading to another buffer
    161 ;; Allows you to refile into different files - specifically to
    162 ;; create new 'parent' headings
    163 (setq org-refile-use-outline-path 'file)
    164 ;; makes org-refile outline working with helm/ivy
    165 (setq org-outline-path-complete-in-steps nil)
    166 (setq org-refile-allow-creating-parent-nodes 'confirm)
    167 (defun +org/opened-buffer-files ()
    168 ;;   "Return the list of files currently opened in emacs"
    169   (delq nil
    170         (mapcar (lambda (x)
    171                   (if (and (buffer-file-name x)
    172                            (string-match "\\.org$"
    173                                          (buffer-file-name x)))
    174                       (buffer-file-name x)))
    175                 (buffer-list))))
    176 
    177 (setq org-refile-targets '((+org/opened-buffer-files :maxlevel . 9)))