Open komali2 opened 1 month ago
I've gotten a little bit closer by copying some of doom emacs' org roam settings: https://github.com/doomemacs/doomemacs/blob/master/modules/lang/org/contrib/roam2.el
(add-hook 'org-roam-mode-hook #'turn-on-visual-line-mode)
The face for the backlink filename is org-roam-olp
Another step: make it so backlinks show a subset of content, preferably just the line or paragraph the backlink is in, rather than the entire file:
https://github.com/org-roam/org-roam/issues/1934
Add to configuration:
(defun my/preview-fetcher ()
(let* ((elem (org-element-context))
(parent (org-element-property :parent elem)))
;; TODO: alt handling for non-paragraph elements
(string-trim-right (buffer-substring-no-properties
(org-element-property :begin parent)
(org-element-property :end parent)))))
(setq org-roam-preview-function #'my/preview-fetcher)
After reloading config or restarting emacs, I believe running org-roam-db-sync
is required to see the change. However, there's some kind of bug in org right now that causes that function to fail for any org file with id links in them (so, ALL org roam related files), see https://github.com/syl20bnr/spacemacs/issues/16520 for the spacemacs specific fix and https://github.com/org-roam/org-roam/issues/2361 for the main issue.
Here's how it's looking now for me:
I would be willing to try to improve the visual appearance of org-roam buffers (though I would prefer org-roam-ui anyway) but I need an example file and example config for org-roam. Would you be willing to provide a minimal example file and config for me @komali2?
Wait, what's org-roam-ui
? I would like to check it out.
Hmm, minimal will take me a second to set up, but here's my config:
https://github.com/komali2/Configs/blob/master/emacs/.spacemacs
Wait, what's
org-roam-ui
? I would like to check it out. https://github.com/org-roam/org-roam-ui https://fosstodon.org/tags/OrgRoamUi
My org roam buffer is quite ugly in spacemacs, and basically useless, however it looks quite nice in doom emacs, when pointing to the same org-roam directory.
First, it was completely useless until I switched off
global-page-break-lines-mode
(see https://github.com/org-roam/org-roam/issues/1772). Now it's at least usable, however I'd like to configure it to look very nice and usable like it does in doom emacs.Here's how it looks for me in spacemacs:
And here's how it looks for the same file in doom emacs:
I'm less concerned with font faces and more really into the automated indenting in the doom version, as well as the fact that in doom, the org roam buffer automatically refreshes when I change. Also, in Doom the buffer just functions like an org file, and I can move around it quite easily, whereas in Spacemacs I constantly get errors if I press
SPC
for example to run an arbitrary command (Wrong type argument: commandp, spacemacs-cmds
). I also like how in doom emacs, the lines actually wrap. I feel like I must have accidentally seriously misconfigured something when installing org roam.Any ideas on how to make this prettier?
My spacemacs config: https://github.com/komali2/Configs/blob/master/emacs/.spacemacs
My Doom config: https://github.com/komali2/Configs/tree/master/emacs/.doom.d
Emacs:
GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0) of 2023-11-14
Spacemacs:Spacemacs v.0.999.0
Edit: See below for some changes I made that made a pretty big difference. The only thing remaining is changing how the org roam buffer displays subheaders and content, e.g., instead of showing
It shows