|
3 | 3 |
|
4 | 4 | (setq imi/second-brain-root-path (concat imi/central-management-system-root-path "second-brain/"))
|
5 | 5 |
|
6 |
| -(setq imi/roam-daily-path (concat imi/second-brain-root-path "note/daily-note/")) |
7 |
| -(setq imi/roam-directory-alist '("Learning-Management-System/blog")) |
| 6 | + |
| 7 | +(setq imi/roam-directory-alist '("Learning-Management-System/1-old-before-book-zixuedaquan" |
| 8 | + "Learning-Management-System/2-zixuedaquan/heima-java-web" |
| 9 | + "Learning-Management-System/2-zixuedaquan/pbr" |
| 10 | + "Learning-Management-System/2-zixuedaquan/methodology" |
| 11 | + "Learning-Management-System/2-zixuedaquan/psychology" |
| 12 | + "Learning-Management-System/2-zixuedaquan/")) |
8 | 13 |
|
9 | 14 | (defun imi/setup-roam-db (name)
|
10 | 15 | (let ((directory (concat imi/second-brain-root-path "note/" name))
|
|
42 | 47 | ("C-c n n" . org-roam-node-find)
|
43 | 48 | ;; ("C-c n g" . org-roam-graph)
|
44 | 49 | ("C-c n g" . org-roam-ui-mode)
|
| 50 | + ("C-c n G" . org-roam-ui-node-local) |
45 | 51 | ("C-c n i" . org-roam-node-insert)
|
46 | 52 | ("C-c n c" . org-roam-capture)
|
47 | 53 | ("C-c n t" . org-roam-tag-add)
|
|
57 | 63 |
|
58 | 64 | (add-to-list 'display-buffer-alist '("\\*org-roam\\*" (display-buffer-in-direction) (direction . right) (window-width . 0.33) (window-height . fit-window-to-buffer)))
|
59 | 65 |
|
60 |
| - (setq org-roam-node-display-template "${tags:35} ${title:80}" ) |
61 |
| - |
| 66 | + ;; (setq org-roam-node-display-template "${tags:35} ${title:80}" ) |
| 67 | + (cl-defmethod org-roam-node-filetitle ((node org-roam-node)) |
| 68 | + "Return the file TITLE for the node." |
| 69 | + (org-roam-get-keyword "TITLE" (org-roam-node-file node))) |
| 70 | + |
| 71 | + (cl-defmethod org-roam-node-hierarchy ((node org-roam-node)) |
| 72 | + "Return the hierarchy for the node." |
| 73 | + (let ((title (org-roam-node-title node)) |
| 74 | + (olp (org-roam-node-olp node)) |
| 75 | + (level (org-roam-node-level node)) |
| 76 | + (filetitle (org-roam-node-filetitle node))) |
| 77 | + (concat |
| 78 | + (if (> level 0) (concat title " @@ ") title) |
| 79 | + (if (> level 0) (concat filetitle " ")) |
| 80 | + (if (> level 1) (concat (string-join olp " > ") "")) |
| 81 | + ))) |
| 82 | + |
| 83 | + (setq org-roam-node-display-template "${tags:30} ${hierarchy:*} ") |
| 84 | + |
| 85 | + |
62 | 86 | ;; daily
|
63 | 87 | (require 'org-roam-dailies)
|
| 88 | + |
| 89 | + (setq imi/roam-daily-path (concat imi/second-brain-root-path "note/daily-note/")) |
64 | 90 | (setq org-roam-dailies-directory imi/roam-daily-path)
|
| 91 | + |
65 | 92 | (setq org-roam-dailies-capture-templates '(("d" "default" entry "* %<%Y-%m-%d %H:%M> %?" :if-new (file+head "%<%Y-%m-%d>.org" "#+title: %<%Y-%m-%d>\n#+filetags: :daily:\n"))))
|
66 | 93 | (setq org-roam-capture-templates '(("d" "default" plain "%?" :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") :unnarrowed t)))
|
67 | 94 |
|
|
82 | 109 |
|
83 | 110 | (use-package consult-org-roam :straight t
|
84 | 111 | :init
|
85 |
| -; (require 'consult-org-roam) |
| 112 | + ; (require 'consult-org-roam) |
86 | 113 | ;; Activate the minor-mode
|
87 | 114 | (consult-org-roam-mode 1)
|
88 | 115 | :custom
|
|
103 | 130 | ("C-c n r" . consult-org-roam-search))
|
104 | 131 |
|
105 | 132 |
|
106 |
| - |
107 | 133 | (provide 'init-roam)
|
0 commit comments