Skip to content

feat(notes): fill in the name of a new note from a template - #104

Merged
dionmunk merged 1 commit into
masterfrom
feat/new-note-name
Oct 7, 2026
Merged

dionmunk merged 1 commit into
masterfrom
feat/new-note-name

Conversation

@dionmunk

@dionmunk dionmunk commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Every new note needed a name typed in, even a quick one meant to be renamed later (#61).

Changes

  • New setting notes.newNoteName: a name template using VS Code's snippet date and time variables, for example ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}-${CURRENT_MINUTE} for 2026-10-07 14-35.
  • New Note (title bar buttons, Alt+N, the command palette) fills the name box with it, selected, so Enter creates the note with that name and typing replaces it.
  • Empty by default, so nothing changes until someone sets it.
  • All the CURRENT_* variables from the VS Code docs are supported, as ${NAME} or $NAME. Month and day names follow VS Code's display language. Unknown variables and other text are kept as typed, as in snippets.
  • The setting's description recommends - between time parts: : isn't allowed in file names on Windows, and New Note already removes it.

A daily-note command (open today's note, creating it if needed), also mentioned in #61, was left out as too specialized for Notes.

Testing

  • npm test: 47 passing, 6 new tests for the template (each date and time variable with padding, short year and milliseconds, month and day names, $NAME with the longest name winning, unix time, unknown variables kept).

  • End to end in VS Code 1.140 on macOS, at about 10:25 local time:

    Case Name box Note created
    no template empty nothing on an empty Enter, as before
    date template, Enter 2026-10-07 10-25, all selected 2026-10-07 10-25.md with # 2026-10-07 10-25
    date template, typed a name 2026-10-07 10-26, all selected custom name.md
    ${CURRENT_HOUR}:${CURRENT_MINUTE} call 10:27 call 1027 call.md
    Alt+N 2026-10-07 10-27, all selected 2026-10-07 10-27.md

Closes #61.

Every new note needed a name typed in, even when it was a quick note to rename
later (#61). The new notes.newNoteName setting is a name template using VS
Code's snippet date and time variables, like
${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}-${CURRENT_MINUTE}.
New Note fills it in, selected, so Enter creates the note and typing replaces
the name. It's empty by default, which keeps the empty name box.

Both ${NAME} and $NAME work, month and day names follow VS Code's display
language, and anything else in the template is kept as typed.
@dionmunk
dionmunk merged commit 16c953d into master Oct 7, 2026
1 check passed
@dionmunk
dionmunk deleted the feat/new-note-name branch October 7, 2026 16:29
This was referenced Oct 7, 2026
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.

Request Feature : auto name

1 participant