Different color links for internal/external in org-roam v2

Hi folks!

I recently (finally!) made the upgrade from org-roam v1 to v2. Thanks for all the work on v2!

I am missing a feature I had in v1: the ability to make links within org-roam be a different color than links outside of org-roam (which mainly would be https URLs).

This little snippet did the trick for me in the past:

      (set-face-attribute 'org-roam-link nil
                          :foreground "medium spring green"
                          :weight 'bold)

As org-roam-link and org-link were separate faces, I could very easily override the org-roam-link and that accomplished the goal.

In org-roam v2, the org-roam-link face is gone and I don’t see any obvious replacement.

Is there a way to set different colors based on org-roam vs. other links in v2?

Thanks!

There isn’t a perfect workaround, but this does a reasonable trick if you don’t have id: links elsewhere in org-mode:

  (defface org-link-id
  '((t :foreground "medium spring green"
       :weight bold
       :underline t))
  "Face for Org-Mode links starting with id:."
  :group 'org-faces)

  (org-link-set-parameters
   "id"
   :face 'org-link-id)
1 Like