Commit 2105a4cc authored by Neil Mather's avatar Neil Mather
Browse files

preparing for org-roam v2

parent 87641500
Pipeline #277392847 failed with stages
in 3 minutes and 5 seconds
#+TITLE: 2021-03-26
* [[id:20210326T231455.451131][Preparing for org-roam v2]]
#+TITLE: My Spacemacs User Config
#+property: header-args:elisp :tangle ~/.spacemacs.d/user-config.el :comments org
#+LAST_MODIFIED: [2021-03-20 Sat 16:06]
#+LAST_MODIFIED: [2021-03-26 Fri 23:26]
* Preamble
:PROPERTIES:
:ID: 20210326T232652.733571
:END:
This is the [[file:literate-configuration.org][literate]] source for my [[file:spacemacs.org][spacemacs]] user config. I use [[file:org-babel.org][org-babel]] to tangle it together into the actual config file.
......@@ -19,6 +22,9 @@ This is the [[file:literate-configuration.org][literate]] source for my [[file:s
** PHP
*** Set up keyboard shortcuts for PHPUnit
:PROPERTIES:
:ID: 20210326T232652.754586
:END:
#+begin_src elisp
(with-eval-after-load 'php-mode
(define-key php-mode-map (kbd "C-c C-t t") 'phpunit-current-test)
......@@ -27,6 +33,9 @@ This is the [[file:literate-configuration.org][literate]] source for my [[file:s
#+end_src
*** Use web-mode for Laravel templates.
:PROPERTIES:
:ID: 20210326T232652.758318
:END:
#+begin_src elisp
(add-to-list 'auto-mode-alist '("\\.blade.php\\'" . web-mode))
#+end_src
......@@ -38,6 +47,9 @@ This is the [[file:literate-configuration.org][literate]] source for my [[file:s
*** Agenda
**** Use org-super-agenda a nicer looking agenda.
:PROPERTIES:
:ID: 20210326T232652.763253
:END:
#+begin_src elisp
(org-super-agenda-mode)
(setq org-agenda-custom-commands
......@@ -103,6 +115,9 @@ This is the [[file:literate-configuration.org][literate]] source for my [[file:s
*** Capturing
**** capture templates
:PROPERTIES:
:ID: 20210326T232652.768075
:END:
#+begin_src elisp
(require 'org-protocol)
(add-to-list 'load-path "/home/neil/.emacs.d/private/org-protocol-capture-html")
......@@ -122,6 +137,9 @@ This is the [[file:literate-configuration.org][literate]] source for my [[file:s
#+end_src
*** Refiling
:PROPERTIES:
:ID: 20210326T232652.772169
:END:
#+begin_src elisp
(setq org-refile-targets '((nil :maxlevel . 9)
......@@ -132,6 +150,9 @@ This is the [[file:literate-configuration.org][literate]] source for my [[file:s
#+end_src
*** Babel
:PROPERTIES:
:ID: 20210326T232652.776075
:END:
#+begin_src elisp
;; babel
(with-eval-after-load 'org
......@@ -152,6 +173,9 @@ Without this, the indentation in org-babel src blocks always gets indented witho
*** Misc
**** Deleting links
:PROPERTIES:
:ID: 20210326T232652.785621
:END:
See: https://emacs.stackexchange.com/questions/10707/in-org-mode-how-to-remove-a-link
#+begin_src elisp
(defun ngm/org-delete-link ()
......@@ -174,12 +198,18 @@ See: https://emacs.stackexchange.com/questions/10707/in-org-mode-how-to-remove-a
#+end_src
**** org-timeline
:PROPERTIES:
:ID: 20210326T232652.790249
:END:
#+begin_src elisp
(require 'org-timeline)
(add-hook 'org-agenda-finalize-hook 'org-timeline-insert-timeline :append)
#+end_src
* Writing and knowledge management
:PROPERTIES:
:ID: 20210326T232652.794077
:END:
I do my writing mostly in org-journal and org-roam.
......@@ -188,6 +218,9 @@ See: https://emacs.stackexchange.com/questions/10707/in-org-mode-how-to-remove-a
#+end_src
** Writing mode
:PROPERTIES:
:ID: 20210326T232652.798196
:END:
A couple of customisations to make writing prose a nice experience.
......@@ -216,6 +249,9 @@ See: https://emacs.stackexchange.com/questions/10707/in-org-mode-how-to-remove-a
org-roam builds on top of org-mode, but I feel like it deserves it's own section.
*** Prefer immediate DB update method.
:PROPERTIES:
:ID: 20210326T232652.802602
:END:
This updates the DB on save, rather than on an idle timer. I was finding idle timer frustrating, as the unexpected DB update interrupted my flow. Updating on save works better for me, as I tend to pause momentarily after a save anyway, as I usually save at the end of a sentence.
#+begin_src elisp
......@@ -223,6 +259,9 @@ This updates the DB on save, rather than on an idle timer. I was finding idle t
#+end_src
*** Wikilink syntax for adding links
:PROPERTIES:
:ID: 20210326T232652.807056
:END:
For inserting links to other wiki pages more quickly, essentially with wikilink syntax.
See: [[file:using-fuzzy-links-aka-wikilinks-in-org-roam.org][Using fuzzy links AKA wikilinks in org-roam]].
......@@ -239,11 +278,17 @@ See: [[file:using-fuzzy-links-aka-wikilinks-in-org-roam.org][Using fuzzy links A
#+end_src
*** Tags
:PROPERTIES:
:ID: 20210326T232652.811020
:END:
#+begin_src elisp
(setq org-roam-tag-sources '(prop last-directory))
#+end_src
*** org-roam capture templates
:PROPERTIES:
:ID: 20210326T232652.815610
:END:
Add CREATED and LAST_MODIFIED properties to the new note.
#+begin_src elisp
......@@ -265,6 +310,9 @@ See: [[file:using-fuzzy-links-aka-wikilinks-in-org-roam.org][Using fuzzy links A
#+RESULTS:
*** Updating timestamps on save
:PROPERTIES:
:ID: 20210326T232652.820294
:END:
I would prefer to do this on org-roam files only.
See [[https://org-roam.discourse.group/t/update-a-field-last-modified-at-save/321/19][Update a field (#+LAST_MODIFIED: ) at save - How To - Org-roam]].
......@@ -278,6 +326,9 @@ See: [[file:using-fuzzy-links-aka-wikilinks-in-org-roam.org][Using fuzzy links A
#+end_src
*** Graph settings
:PROPERTIES:
:ID: 20210326T232652.824834
:END:
Exclude some of the big files from the graph.
#+begin_src elisp
......@@ -285,6 +336,9 @@ Exclude some of the big files from the graph.
#+end_src
*** org-roam-server
:PROPERTIES:
:ID: 20210326T232652.829175
:END:
#+begin_src elisp
(setq org-roam-server-light-dir "~/Code/org-roam-server-light")
......@@ -303,15 +357,47 @@ Exclude some of the big files from the graph.
(setq org-roam-server-default-exclude-filters "[{ \"tags\": \"journal\", \"id\" : \"Recent changes\", \"id\":\"recentchanges\" }]")
#+end_src
*** Using id links
:PROPERTIES:
:ID: 20210326T232652.833951
:END:
#+begin_src elisp
(setq org-id-link-to-org-use-id t)
(setq org-id-method 'ts)
(setq org-roam-prefer-id-links t)
#+end_src
#+begin_src elisp
(defun ngm/org-hide-properties ()
(interactive)
"Hide org headline's properties using overlay."
(save-excursion
(goto-char (point-min))
(while (re-search-forward
"^ *:PROPERTIES:\n\\( *:.+?:.*\n\\)+ *:END:\n" nil t)
(overlay-put (make-overlay
(match-beginning 0) (match-end 0))
'display ""))))
(add-hook 'org-mode-hook #'ngm/org-hide-properties)
#+end_src
* Look'n'feel
** Themes
:PROPERTIES:
:ID: 20210326T232652.841598
:END:
#+begin_src elisp
(doom-themes-treemacs-config)
(doom-themes-org-config)
#+end_src
** Solaire
:PROPERTIES:
:ID: 20210326T232652.845889
:END:
See https://github.com/hlissner/emacs-solaire-mode
#+begin_src elisp
......@@ -337,6 +423,9 @@ See https://github.com/hlissner/emacs-solaire-mode
#+end_src
** Tabs (centaur)
:PROPERTIES:
:ID: 20210326T232652.850925
:END:
Not currently using this, as I think it broke something.
#+begin_src elisp
......@@ -363,6 +452,9 @@ See https://github.com/hlissner/emacs-solaire-mode
#+end_src
** Helm
:PROPERTIES:
:ID: 20210326T232652.855435
:END:
#+begin_src elisp
(defun open-local-file-projectile (directory)
......@@ -397,6 +489,9 @@ See https://github.com/hlissner/emacs-solaire-mode
#+end_src
*** Remove duplicates in helm command history
:PROPERTIES:
:ID: 20210326T232652.860427
:END:
See: https://github.com/syl20bnr/spacemacs/issues/13564
#+begin_src elisp
......@@ -407,6 +502,9 @@ See: https://github.com/syl20bnr/spacemacs/issues/13564
* Communications
** mu4e (mail)
:PROPERTIES:
:ID: 20210326T232652.868503
:END:
#+begin_src elisp
;; mu4e
......@@ -466,6 +564,9 @@ See: https://github.com/syl20bnr/spacemacs/issues/13564
#+end_src
** IRC (erc)
:PROPERTIES:
:ID: 20210326T232652.872918
:END:
#+begin_src elisp
(setq erc-hide-list '("JOIN" "PART" "QUIT"))
......@@ -474,6 +575,9 @@ See: https://github.com/syl20bnr/spacemacs/issues/13564
* Misc
** Tidal
:PROPERTIES:
:ID: 20210326T232652.876750
:END:
#+begin_src elisp
;; tidal
;;(add-to-list 'load-path "/home/neil/.emacs.d/private/tidal")
......
:PROPERTIES:
:ID: 20210326T232003.148801
:END:
#+TITLE: org-roam
#+begin_quote
......
:PROPERTIES:
:ID: 20210326T231455.451131
:END:
#+title: Preparing for org-roam v2
#+CREATED: [2021-03-26 Fri 23:08]
#+LAST_MODIFIED: [2021-03-26 Fri 23:22]
A big redesign is on the way for how [[file:org-roam.org][org-roam]] works - lots of discussion [[https://org-roam.discourse.group/t/org-roam-major-redesign/][here]]. The biggest change seems to be a move to use id links rather than file links.
Lots of people in the thread seem happy about this. A couple of things that I'm concerned about:
- will this work fine with org-publish?
- are you then more dependent on org / org-roam to view these files?
I think things will probably work with org-publish fine, as id links are a long-standing org-mode thing in their own right, not a thing new to org-roam.
The second point bugs me a bit. I sometimes read my private wiki in orgzly / orgro on my phone. I wonder how this will be affected. Also I just like file links as being slightly more software-agnostic.
Hey ho. I'll try using id links for a bit now. They work already in org-roam v1 from what I understand, as well as file links.
Some snippets I'll add to my config:
#+begin_src elisp
(setq org-id-link-to-org-use-id t)
(setq org-id-method 'ts)
(setq org-roam-prefer-id-links t)
#+end_src
and
#+begin_src elisp
(defun ngm/org-hide-properties ()
"Hide org headline's properties using overlay."
(save-excursion
(goto-char (point-min))
(while (re-search-forward
"^ *:PROPERTIES:\n\\( *:.+?:.*\n\\)+ *:END:\n" nil t)
(overlay-put (make-overlay
(match-beginning 0) (match-end 0))
'display ""))))
(add-hook 'org-mode-hook #'ngm/org-hide-properties)
#+end_src
:PROPERTIES:
:ID: e002fceb-b79d-4a21-92ca-81c1882456e6
:END:
#+title: Worker self-directed nonprofit
#+CREATED: [2020-12-27 Sun 13:06]
#+LAST_MODIFIED: [2021-01-01 Fri 17:02]
#+LAST_MODIFIED: [2021-03-26 Fri 22:45]
[[https://www.theselc.org/workplace_democracy_in_nonprofit_organizations][- Workplace Democracy in Nonprofit Organizations - Sustainable Economies Law Ce...]]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment