Note title automatically generated from first words of the Note (similar to Joplin)

You can accomplish this with the Templater plugin.

I have turned on the option to allow Templater to trigger on new file creation. My new notes use the following template:

<%*
  let title = tp.file.title
  if (title.startsWith("Untitled")) {
    title = await tp.system.prompt("Title");
    await tp.file.rename(`${title}`);
  } 
  tR += "---"
%>
tags: Note <%tp.file.creation_date("YYYY")%>
---
# <%* tR += `${title}` %>

<% tp.file.cursor() %>

___

## References:
- 

---
creation date:: [[<%tp.file.creation_date("YYYY-MM-DD")%>]] <%tp.file.creation_date("HH:mm")%>

The script in the template asks for a name if the note is untitled and then renames the note with the title and puts it in a header at the top of the note.

This script is not my concoction. I modified one that I found elsewhere–but I forget where.

I hope it helps!

16 Likes