Display Roam tags after title

Is there an option to display the #+roam_tags: after the title in the dropdown list when selecting a file? Perhaps in the same way that Org Mode does?

Current:
(todo) Miscellaneous Debris

Preferred:
Miscellaneous Debris :todo:

1 Like

By the looks of it, you could do this by overriding this function below.

The parenthesis is added by org-roam–prepend-tag-string; it’s also responsible for prependeding tags before displaying the selection candidates.

To something like this below. Not tested, you might need to work with it a bit more.

(defun org-roam--prepend-tag-string (str tags)
  "Prepend TAGS to STR."
  (concat
   str
   (when tags
     (propertize (format ":%s: " (s-join org-roam-tag-separator tags))
                 'face 'org-roam-tag)))

Thanks, that worked (just needed to add a parenthesis at the end) :slight_smile:

Time to learn some more elisp to make the tags start at a fixed spot

1 Like

oh good to know it worked :slight_smile:

I am trying to work out how to use the same tag placement as Org Mode (org-align-tags function).

Yeah, that sounds good.
I do not know your fluency in Elisp, but this function looks a bit complicated to me. I would start dead simple, like this:

(indent-to 50)

Adjust the number according to your need.

Depending on your value of org-tags-column, this should get you pretty close to what Org does, I guess.

(indent-to (abs org-tags-column))

1 Like

When I add this to the function ,the point in my current buffer moves.

(defun org-roam--prepend-tag-string (str tags)
  "Prepend TAGS to STR."
  (concat
   str
   (when tags
     (indent-to (abs org-tags-column))
     (concat " "
     (propertize (format ":%s:" (s-join org-roam-tag-separator tags))
                 'face 'org-roam-tag)))))

P.S. I use Helm, that might have something to do with it.

Wrap your code with save-excursion to avoid your point moving I guess?