9

Before I installed org-roam I saw a screenshot or a video somewhere in which the tags of an org-roam note looked like links. I was under the impression that org-roam allows you to see all notes of a particular tag.

I added a tag to my test note, but I don't see a way to see all notes with that tag. I also could not find any hints on that in the org-roam User Guide.

How can I see a list of all notes with a particular tag (ideally as a list of links so that I can click on a note to navigate to it)?

1
  • do you mean something like listing all notes linked to a tag in a sidebuffer or window? Because I am probably looking for something similar after having watched 'How to Use Roam to Outline a New Article in Under 20 Minutes' by Nat Eliason (which is also linked in one of the org-roam blog posts).
    – MKroehnert
    Mar 19, 2021 at 20:33

3 Answers 3

4

You can search by tag by running org-roam-find-file. The tags will be displayed in brackets next to the titles of the files.

To see a list of files as you type, set org-roam-completion-system to 'ido.

(setq org-roam-completion-system 'ido)

Alternatively,

  • install Ivy and enable ivy-mode, or
  • install Helm and enable helm-mode.

Ido, Ivy, and Helm are all completion systems.

Additional reading about completion systems

  • See Mastering Emacs - Introduction to Ido Mode for an (in-depth) introduction to Ido as a completion system. Some excerpts:

    • A description of builtin "completing-read", the prompt that you're seeing:

    [...] if you were to search for the buffer “*Customize Group: Foobar*” without Ido you’d have to contort your fingers and type the *, then TAB (and hope it completes) and if not, type in some more; then rinse and repeat.

    • Describing Ido:

    With Ido you’d type a few characters until you find the match, or until you narrow down your list of matches to a manageable subset, and then press RET. Even better, with fuzzy matching you can find things even more efficiently. So the above buffer name could be found by typing “cgf” – c for Customize, g for Group and f for Foobar.

  • See Helm Wiki#General concept for what Helm is in addition to just being a vertical Ido.

    People often think helm is just something like ido but displaying completion in a vertical layout instead of an horizontal one, it is not, helm is much more powerful than that.

  • See Ivy Manual#Introduction

    Ivy is for quick and easy selection from a list. When Emacs prompts for a string from a list of several possible choices, Ivy springs into action to assist in narrowing and picking the right string from a vast number of choices.

6
  • When I enter M-x org-roam-find-file I get a prompt asking me for a file name. Oct 21, 2020 at 9:53
  • @Mentiflectax You can also enter tags, try typing the tag you want. Oct 21, 2020 at 20:21
  • It does not work. If I type in at the file prompt, it creates a new capture file with the text I entered as the title (#+TITLE). Oct 22, 2020 at 15:05
  • Are you using helm? Oct 22, 2020 at 20:52
  • No, I am not using helm. Oct 23, 2020 at 8:23
1

If you want the node search to only display nodes with a specific tag, org-roam-node-find accepts a filter function as its third argument. This is covered incidentally in a video by System Crafters. The code from that video is:

(defun my/org-roam-filter-by-tag (tag-name)
    (lambda (node)
        (member tag-name (org-roam-node-tags node))))

(defun my/org-roam-find-project ()
    (interactive)
    ;; Select a project file to open, creating it if necessary
    (org-roam-node-find nil nil
        (my/org-roam-filter-by-tag "Project")))
0

The hack to enter org-roam tags linking them to empty files has been deprecated in org-roam since the addition of #+ROAM_TAGS

Instead, try adding a line such as #+ROAM_TAGS: tag1 tag2 tag3 tag4 to an org-file to your org-roam-directory.

Then, rebuild the cache using M-x and org-roam-db-build-cache. Now your completion system (ido, helm etc.) will be able to display the tags inside brackets when using org-roam-find-file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.