If it helps anyone else, I made a quick Templater script to solve the @-mention issue for me.
When I want to mention someone I use the hotkey Alt+2 (the @ key) which launches the Templater script, I start typing the name of the person and press Enter, and the script will automatically insert the link to that page. Super super fast.
The people in the suggester popup are simply notes inside a People
folder. In the gif above you can see that I have prefixed my people with the ‘@’ symbol, but you do not need to do that. No symbol is needed, it just works off the names of the notes.
Update:
I have since changed this to use the character rather than the @, so now instead of a
@John
note, I have a 👤John
note. Everything still works the same. Please note, this isn’t an icon or a special font, it’s an emoji character - you can just copy and paste it, and it also works perfectly well in filenames. (Copy this one: 👤
)
In a note it looks like this:
And here it is in Windows Explorer - no issues putting it in a file name:
Here’s the Templater template:
<%*
// Get the list of people
const folder = 'People'
const people = this.app.vault.getFiles().filter(f => f.path.startsWith(folder)).map(f => f.basename)
// Pop the suggester
const person = await tp.system.suggester(people, people)
return person ? `[[${person}]] ` : ''
%>
If you also have Dataview installed you can use this template instead, which sorts the people from most mentioned to least mentioned to make it easy to visually spot your most-referenced people. It also strips the @
or 👤
character before displaying the list, so that you only see names.
<%*
// Get the list of people
const people = app.plugins.plugins.dataview.api.pages('"People"')
.sort(x => x.file.inlinks.length, 'desc')
.file.name
// Pop the suggester
const person = await tp.system.suggester(people.map(x => x.replace(/^\W+/, '')), people)
return person ? `[[${person}]] ` : ''
%>