farux / obsidian-auto-note-mover

This is a plugin for Obsidian (https://obsidian.md).
MIT License
259 stars 22 forks source link

Feature request: Nested tags are matched when their parent tag is matched. #14

Closed sometxdude closed 2 years ago

sometxdude commented 2 years ago

A note tagged with #Foo/bar would be moved with a rule that includes #Foo or #Foo/bar.

I have a lot of nested tags, and I want to put them all into a folder by only specifiying the root tag #Foo. Otherwise, I would have to create a separate rule for every nested tag which would take a long time and clutter up the rules list.

Perhaps this behavior could be enabled/disabled with a toggle switch.

farux commented 2 years ago

#Foo and #Foo/bar are actually two completely different tags, but Obsidian treats them as nested tags for convenience. For example, if there is another tag #Foobar here, we need a regular expression to distinguish the three tags.

However, ANM does not use regular expressions to check tags, because it would be inconvenient to always have to create rules that take into account things like the three tags in the example, and it would be impossible to use the suggested tags directly. Also, checking with regular expressions is slower than checking tags as is.

If there are a lot of requests, I'll think about it, but in that case, users will have to recreate all the rules.

farux commented 2 years ago

Added option to check tags for regular expressions in 1.1.0. To use it, all rules need to be regular expression compatible.

sometxdude commented 2 years ago

Thanks. I just started using the regular expression functionality and its working great for my nested tags. This is a must have plugin that I'll be using all the time going forward. Nice work.

farux commented 2 years ago

Thank you. It's my pleasure