I am also facing this issue and it would be great that tags autocomplete in YAML frontmatter. Ideally, both "#…" and plain text should work for autocomplete, in both list and bracket formats (having already one of all working would be nice).
Thank you! I was searching the forum looking for exactly this. I just started actively using YAML frontmatter in the last couple of days. Every new note has it with tags, and if I pull up an older note that doesn’t, I add. Really working for me… except for the autocomplete issue. I was finding I was also needing to use the Tag Wrangler plug-in regularly to rename/combine tags.
I’ll try the workaround of typing # and then removing, but not ideal.
I solved it with the AHK script (Autohotkey app for PC must installed). I will write in the line: tags: [ #newtag ] when I will suggest the used tags. I stay in line and run the script. He first checks to see if I’m in the tags: line and then removes all # characters in that line in bulk.
Probably a better script to write, but I’m a beginner.
#IfWinActive, ahk_exe Obsidian.exe ;you must by in the obsidian window
{
; CTR+SHIFT+A shortcut for run the script. Character "A" you can change it for your own shortcut
^+a::Gosub, obsidianHashTagReplace
return
}
obsidianHashTagReplace:
send, {home}
send, +{End}
send, ^c
If InStr(Clipboard, "tags: [")
{
} Else {
MsgBox, You are probably not in the YAML Tag line.
Exit
}
Clipboard := StrReplace(Clipboard,"#","")
send, ^v
return
If this is still an issue for others, it’s possible to retain the # by quoting each tag after autocompleting or quoting them all together. This works for me in v0.12.15 without issue:
If I write some_tag I do not get any suggestions from existing tags. I might mistype it and not who up in a query for the real spelling.
If I type it with # like #some_other_tag I do get suggestions. But after saving/closing the document. It does not show up in searches for the tag. It does not count as tagged with some_other_tag.
I suspect it is treated as a comment but I don’t think it should.
Proposed solution
Two approaches:
Don’t ignore tags with#. The search (and links, etc.) for tags:#some_other_tag should should the document with the line tags: #some_other_tag
When typing something in the metadata section on the line beginning with tags: , suggest tags like when typing #
This is what I do and it works great, but I definitely second this feature request. If tags in frontmatter are officially supported, autocomplete for tags in frontmatter should be too.
Well that solves half of my problem. I also agree that this should just be a default behavior built into Obsidian.
My other issue is that tags in the frontmatter won’t get the text formatting and become clickable like they do elsewhere. Unfortunately I’ll still be writing tags on a separate line right under the frontmatter in dataview inline format instead:
---
aliases: []
---
tags:: #tag1 #tagsss/tag2
# Note Title