A Request and Proposal for Multi-Word Tags

Can we talk about tags?

According to Sascha on the Zettelkasten.de blog, there are two kinds of tags:

  • Topics -> Tagging everything relevant to a given topic
  • Objects -> Specific to a concept (real or abstract)

Broad connections made through topics are messy and fail to provide precise connections between notes. Sascha questions whether “#diet” applies to your personal diet or nutrition science? Assessing the diet tag’s topical applicability supports Andy Matuschak’s perspective on high-value explicit associations. He mentions the terms a person uses to describe their notes will change over time. I have seen this behavior in myself. For example, when I write a log of my workout progress, I have oscillated between terms such as exercise, fitness, or workout. The more these terms change, the less valuable to notes become because I have not created meaningful links within the archive.

Tagging objects offers greater precision, which benefits you as your archive grows. Sascha uses a sniper rifle versus shotgun analogy to describe tagging. I believe single-word tags force the user to think topically. Andy Matushack takes a shot at tags too. Andy prefers explicit associations between notes rather than general associations through tags.

How can, or even should, we use tags for a more efficient purpose? One solution I have tested in my archive is multi-word tags. A few extra words allow you a buffer to better explain the concept behind your note. Consider my growing collection of images featuring Minecraft building details as an example. I analyze these images for new techniques, and then my children and I apply the details to our structures. The only problem is single-word tags limit my ability to pinpoint these notes in my archive. Currently, “#minecraft” reveals several notes, and not all of them are related to building. On the other hand, a multi-word tag such as “#building inspiration” offers a more conceptual look at my notes while revealing the information I want.

Currently, Obsidian allows single-word tags (unless I am missing something). I believe the app should support multi-word tags. I wrote a regular expression example to do my part in providing a solution for my requested feature. I’m not sure how the development team handles matching tags, or how complicated a task it would be to allow multi-word tags in Obsidian.

Depending on how a person organizes their tags, this regular expression \b(?<=\#).*$\b forces you to add tags on a new line. I realize some prefer to write their tags on a single line separated by a #. Unfortunately, I am a novice and hobbyist at programming, and this expression was my best attempt.

In closing, I humbly submit my feature request for multi-word tags because I believe these tags offer flexibility and specificity not possible with one word. Ultimately, we all want to find greater connections between our ideas, and multi-word tags may help achieve this goal.

Sources

14 Likes

For comparison, Roam doesn’t have tags - pages and tags are the same. I think they don’t have tags because the pages can function as tags. So pages can be multi-word. And if you visit the page, then that acts as a search via backlinks.
So my question is can you get the functionality you need from multi-word tags from multiword pages?
Also, what about using CameCase or snake_case etc…as an alternative.

1 Like

A simple way to do this could be to bound the multi-word tag with #, similar to how Bear does it.

#tag - single word tag
#tag with multiple words# - multi word tag

That would likely simplify the regex and processing needed to find and render these tags.

12 Likes

Hyphens between the words works and using multiple tags is more flexible:
#minecraft-building-inspiration
#minecraft, #building, #inspiration

4 Likes

Yes, I believe hyphen is the only character allowed, but here is a related request to include underscores https://forum.obsidian.md/t/underscore-not-handled-in-tags/493

2 Likes

Spaces in tags would be strange, me thinks.

I would love to use hierarchical tags, similar to how Tildes does them. Here is their reference for how it works: https://docs.tildes.net/instructions/hierarchical-tags

Basically, you can have #health and nest them like #health.brain, #health.environmental, … (They’re also called sub-tags.)

I believe this is a similar concept to multiword tags and accomplishes a similar goal.

3 Likes

As the community points out, there are many alternative approaches to using tags.

I’m unfamiliar with Roam, and I’m having a hard time grasping @Shane comments.

CamelCase, hyphen’s, and underscores are practical approaches. While tried and true in programming, their aesthetic and readability is off-putting when reviewing notes. Just my opinion. Furthermore, as Obsidian does not yet have a mobile app, many of the mobile alternatives the team recommends, at least on iOS, do not implement hyphens or underscores in tags. And camelCase is transformed into lower case causing clarity issues.

Overhauling the tag system for one guy is an insane expectation on my part. I get that. One of Obsidian’s most endearing features has been it’s flexibility. Accommodating multiple words in tags would expand the app’s ability to meet different workflows and styles.

@justindirose mentions Bear’s approach of sandwiching multiple words between hashtags. Bear has established itself as a capable writing app. Perhaps the Obsidian team will consider this approach? It seems to be a good trade-off for users that don’t find multi-word tags so strange.

2 Likes

This is somewhat related to my request for extracting tags from YAML front matter. The unsaid assumption there was that multiword tags should be supported.

2 Likes

I’m not sure that having spaces in tags is a good idea. I currently have tags on one line in a YAML header in each file, separated by spaces. So tags with spaces would mess that up.

I do as @Dor suggested for multi-word tags:

Hyphens between the words works and using multiple tags is more flexible:
#minecraft-building-inspiration
#minecraft, #building, #inspiration

In my mind, hyphens already solve this use-case quite well and, I think, better than spaces would.

On another note, I have created another feature request that would greatly enhance the use of multi-word tags, regardless of how the words are separated:
Fuzzy matching in tag entry autocompletion

In the meantime, you can use dashes, though I realize that’s not necessarily convenient.

:warning: Please backup your vault before trying any of this. Batch regex replacements can irreparably mess up your notes. :warning:

If you’re willing to accept the compromise suggested by @ryanjamurphy, and able to perform a regex search & replace on your exported files (using VS Code, for example), the following expressions will replace #multi word tag# with #multi-word-tag.

(I could only do it using two sweeps)

  1. Find:
    (?<=#\w[\w ]+) (?=[\w ]+\w#)
    Replace:
    -
  2. Find:
    #([\w-]+)#
    Replace:
    #$1
1 Like

I think it’s quite natural to have the possibility to put spaces in tag names. Imagine when you take notes on topics which have very long names (like in academia): some have abbreviations, but not always (and having only abbreviations reduces clarity; especially when several names have the same abbreviation, which is common). I find adding hyphens less readable. Also in the same context, typical bibliography management softwares (like Zotero) allow for tags with spaces, so it would be useful for matching when people already have a collection with those softwares.

A possibility would be to enforce keeping space by putting quotes around the tag. Then for people who don’t care (or don’t like) spaces in tags, this would be transparent. This also gives a very clear signal that there are spaces in tags and I guess that it would not complicate too much the analysis.

Somewhere I have seen #[multi word tag] syntax which would be more reliable IMHO. And aligned with markdown style to delimit text spans e.g. for purpose of linking.

#tag This sentence seems to start by tag unless you read it till the end when you realize that acording to some suggestions actually whole sentence is a tag#

Current solution/workaround:

If you need to use spaces for some reason (not hyphens, CamelCase, … suggested in posts above), Then Enclose multi-word key string in double brackets, i.e. create wiki link [[multi word tag]] instead of #multi-word-tag.

Related feature requests:

I agree with @nixsee here, I think hyphens or underscores are fine once you get accustomed to thinking that way. Usually better to stick to standards whenever possible. I’m starting to heavily use the YAML frontmatter for tagging, and I see the #[some tag] syntax breaking things there.

Just wanted to drop in and lend some more support here, I’m considering switching to Obsidian from Bear but the lack of multiple word tags is a really big deal for me for many of the reasons listed and it might be enough to keep me using Bear.

This may seem like an outlier issue but the number of other productivity applications that support spaces in tags ought to lend a little credence. Off the top of my head here are a few apps and systems that do: Apple’s file system tagging across multiple platforms, DEVONthink, OmniFocus, Hypothes.is, Readwise, 1Password, Drafts, MindNode, Evernote, Keep It, Ulysses, Flickr, Medium and Raindrop.io.

Hi Justin, How those Word tags look like? (I’m curious)

Perhaps It can be implemented as plugin?

Bear is probably the best example since it also has inline tags within the text of the note, I can’t comment on Justin’s workflow but here is a couple of examples of how I use them:

Here’s an example of my tags navigator, it may be worth mentioning that Bear organizes things exclusively by tags, there’s are no folders/notebooks/groups so flexible tagging with spaces and nesting is especially important.

Here’s an example of how they work inline, the #my tag name here# syntax isn’t the most elegant looking but it works really well.

In my Obsidian testing some of this type of structure is going into folder names and Obsidian seems to manage them just fine; I see little reason the tagging system would need to be any less flexible than file linking but I am new here and still learning my way around the application.

3 Likes