epwalsh / epwalsh/obsidian.nvim

Notes creation from templates

Open
#467 10 comments 8 reactions 0 assignees View on GitHub
feature request
Dominant language
Lua
Stars
6.2k
Forks
250
PR merge metrics
No merged PRs in 30d

Description

### 🚀 The feature, motivation and pitch

Current support of templates seems to only allow inserting template-based text in **already created note.**
It would be super nice to be able to create new notes **from templates** as well.
The flow I have in mind is something like this:
1. `:ObisidianNewFromTemplate [title]`
2. The list of available templates shows up
3. Upon selection, a new note is created, based on the selected template

That also requires templates to support substitutions from values that are only available at the note creation time, for example, an id, generated by `note_id_func`.

### Alternatives
Custom command:
```
vim.api.nvim_create_user_command("ObsidianNewFromTemplate", function()
vim.cmd("ObsidianNew")
vim.cmd("normal! G") -- go to end of file
vim.cmd("ObsidianTemplate")
end, {})
```
as suggested by @sotte

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by tracing the existing :ObsidianNew and :ObsidianTemplate commands and note_id_func handling; done means a new :ObsidianNewFromTemplate flow can select a template, create the note from it, and resolve creation-time substitutions.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.