Skip to content

feat: support configurable templates for daily buffer creation#128

Open
chipsenkbeil wants to merge 1 commit into
mainfrom
feat/67-daily-buffer-template-support
Open

feat: support configurable templates for daily buffer creation#128
chipsenkbeil wants to merge 1 commit into
mainfrom
feat/67-daily-buffer-template-support

Conversation

@chipsenkbeil

@chipsenkbeil chipsenkbeil commented Feb 20, 2026

Copy link
Copy Markdown
Owner

Merge Order

This PR is part of the dailies chain. Merge after #127 (before #129).

Summary

  • Addresses make_daily_buffer template #67
  • Adds extensions.dailies.default_template_key config option
  • When navigating to a daily note (goto_date, goto_today, etc.) and the file does not exist, uses the specified template key from dailies templates to create the buffer content
  • Falls back to current hardcoded structure if key is nil or not found
  • Allows users to customize daily note content created via goto_* commands, not just via capture_date

Test plan

  • Set extensions.dailies.default_template_key = "d" in config
  • Navigate to a date that has no existing note via goto_date or goto_today
  • Verify the new buffer uses the template content from the "d" template
  • Verify that without the config option set, behavior is unchanged

Add extensions.dailies.default_template_key config option. When
navigating to a daily note (goto_date, goto_today, etc.) and the
file does not exist, use the specified template key from the dailies
templates to create the buffer content. Falls back to the current
hardcoded structure if the key is nil or not found.

This allows users to customize the content of daily notes created
via goto_* commands, not just via capture_date.
@kihkelmaa

kihkelmaa commented Jun 18, 2026

Copy link
Copy Markdown

Hit a runtime error in dailies.lua that traces back to the ordering of make_dailies_templates.

Error:

vim.schedule callback: unhandled promise rejection: { "...m/lazy/org-roam.nvim/lua/org-roam/extensions/dailies.lua:122: attempt
 to call global 'make_dailies_templates' (a nil value)" }
stack traceback:
        [C]: in function 'error'
        ...al/share/nvim/lazy/orgmode/lua/orgmode/utils/promise.lua:75: in function <...al/share/nvim/lazy/orgmode/lua/orgmode/
utils/promise.lua:67>

I saw that make_dalies_templates was requested before function was defined.

-- at line ~122
        local expanded = make_dailies_templates(roam, date)

-- at line ~171
function make_dailies_templates(roam, date)
  ...
end

Moving the definition above the call resolved it on my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants