commit e3a1f01e1cc0be3584ebbc6aadcecf8a1a267b68 parent 424fb628530e0ce1c1b964496541fc580e682252 Author: Yohanes Bandung Bondowoso <hi@ybbond.dev> Date: Thu, 25 Jun 2020 22:42:48 +0700 update doom settings along with org-roam Diffstat:
| M | .doom.d/+org.el | | | 81 | ++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------- |
| M | .doom.d/+ui.el | | | 7 | +++++++ |
| M | .doom.d/init.el | | | 8 | ++++++-- |
3 files changed, 66 insertions(+), 30 deletions(-)
diff --git a/.doom.d/+org.el b/.doom.d/+org.el @@ -5,8 +5,11 @@ ;; (setq org_notes "~/Library/Mobile Documents/com\~apple\~CloudDocs/Notes" (setq org_notes "~/Notes" org-directory org_notes - org-ellipsis " ▼ " - deft-directory org_notes) + deft-directory org_notes + org-roam-directory org_notes + org-roam-db-location "~/Notes/org-roam.db" + org-id-link-to-org-use-id t + org-ellipsis " ▼ ") ;; I use C-c c to start capture mode (global-set-key (kbd "C-c c") 'org-capture) @@ -20,48 +23,70 @@ ("NEXT" ("WAITING") ("CANCELLED") ("HOLD")) ("DONE" ("WAITING") ("CANCELLED") ("HOLD"))))) -;; Org roam + +(use-package! org-roam + :hook + (after-init . org-roam-mode)) + (after! org-roam - (setq org-roam-directory org_notes) (add-hook 'after-init-hook 'org-roam-mode) (setq org-roam-graph-viewer "/usr/bin/open") (setq org-roam-capture-ref-templates '(("r" "ref" plain (function org-roam-capture--get-point) "%?" :file-name "websites/${slug}" - :head "#+TITLE: ${title}\n#+ROAM_KEY: ${ref}\n- SOURCE :: ${ref}" + :head "#+title: ${title}\n#+author: ${author}\n#+roam_key: ${ref}\n#+roam_tags: websites\n- source :: ${ref}" :unnarrowed t)))) + (setq org-roam-dailies-capture-templates '(("d" "daily" plain (function org-roam-capture--get-point) "%?" :immediate-finish t :file-name "journals/%<%Y-%m-%d>" - :head "#+TITLE: %<%A>, %<%d> %<%B> %<%Y>" + :head "#+title: %<%A>, %<%d> %<%B> %<%Y>\n#+roam_tags: journals\n" :unnarrowed t))) + (setq org-roam-capture-templates '(("d" "default" plain (function org-roam-capture--get-point) "%?" :file-name "%<%Y%m%d%H%M%S>-${slug}" - :head "#+TITLE: ${title}\n" + :head "#+title: ${title}\n" + :unnarrowed t) + ("t" "tags" plain (function org-roam-capture--get-point) + "%?" + :file-name "tags/%<%Y%m%d%H%M%S>-${slug}" + :head "#+title: ${title}\n#+roam_tags: tags" + :unnarrowed t) + ("p" "products" plain (function org-roam-capture--get-point) + "%?" + :file-name "products/%<%Y%m%d%H%M%S>-${slug}" + :head "#+title: ${title}\n#+roam_tags: products\n" + :unnarrowed t) + ("i" "people" plain (function org-roam-capture--get-point) + "%?" + :file-name "people/%<%Y%m%d%H%M%S>-${slug}" + :head "#+title: ${title}\n#+roam_tags: people\n" :unnarrowed t))) -(use-package deft +(use-package! deft :after org - :bind - ("C-c n d" . deft) :config (setq deft-recursive t) (setq deft-use-filter-string-for-filename t) - (setq deft-incremental-search t)) + (setq deft-default-extension "org") + (setq deft-incremental-search t) + (add-hook 'after-init-hook 'org-roam-db-build-cache) + :bind + ("C-c n d" . deft)) -(use-package org-journal +(use-package! org-journal :bind ("C-c n j" . org-journal-new-entry) :config (setq org-journal-dir "~/Notes/journals/") - (setq org-journal-date-prefix "#+TITLE: ") + (setq org-journal-date-prefix "#+title: ") (setq org-journal-file-format "%Y-%m-%d.org") - (setq org-journal-date-format "%A, %d %B %Y")) + (setq org-journal-date-format "%A, %d %B %Y\n#+roam_tags: journals\n")) (setq org-journal-enable-agenda-integration t) (after! org @@ -77,18 +102,18 @@ ;; Refile a heading to another buffer ;; Allows you to refile into different files - specifically to ;; create new 'parent' headings -(setq org-refile-use-outline-path 'file) +;; (setq org-refile-use-outline-path 'file) ;; makes org-refile outline working with helm/ivy -(setq org-outline-path-complete-in-steps nil) -(setq org-refile-allow-creating-parent-nodes 'confirm) -(defun +org/opened-buffer-files () - "Return the list of files currently opened in emacs" - (delq nil - (mapcar (lambda (x) - (if (and (buffer-file-name x) - (string-match "\\.org$" - (buffer-file-name x))) - (buffer-file-name x))) - (buffer-list)))) - -(setq org-refile-targets '((+org/opened-buffer-files :maxlevel . 9))) +;; (setq org-outline-path-complete-in-steps nil) +;; (setq org-refile-allow-creating-parent-nodes 'confirm) +;; (defun +org/opened-buffer-files () +;; "Return the list of files currently opened in emacs" +;; (delq nil +;; (mapcar (lambda (x) +;; (if (and (buffer-file-name x) +;; (string-match "\\.org$" +;; (buffer-file-name x))) +;; (buffer-file-name x))) +;; (buffer-list)))) + +;; (setq org-refile-targets '((+org/opened-buffer-files :maxlevel . 9))) diff --git a/.doom.d/+ui.el b/.doom.d/+ui.el @@ -33,3 +33,10 @@ ;; Disable clipboard altogether. ;; Use clipboard register to copy-paste with system clipboard! (setq select-enable-clipboard nil) + +;; (after! dired +;; ;; (setq dired-listing-switches "-aBhl --group-directories-first" +;; (setq dired-listing-switches "-aBhl" +;; dired-dwim-target t +;; dired-recursive-copies (quote always) +;; dired-recursive-deletes (quote top))) diff --git a/.doom.d/init.el b/.doom.d/init.el @@ -27,8 +27,8 @@ :ui deft ; notational velocity for Emacs doom ; what makes DOOM look the way it does - doom-dashboard ; a nifty splash screen for Emacs - doom-quit ; DOOM quit-message prompts when you quit Emacs + ;; doom-dashboard ; a nifty splash screen for Emacs + ;; doom-quit ; DOOM quit-message prompts when you quit Emacs ;;fill-column ; a `fill-column' indicator hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW ;;hydra @@ -177,3 +177,7 @@ :config ;;literate (default +bindings +smartparens)) + + +;; Respects soft line wrapping navigation +(setq evil-respect-visual-line-mode t)