Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit commands in templater after hitting "replace templates in the active file". #1530

Open
DVDKAY opened this issue Jan 21, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@DVDKAY
Copy link

DVDKAY commented Jan 21, 2025

A while ago I made a bunch of commands in templater and for the life of me I cannot figure out what hotkey I need to re-edit them. I can create a command like <% tp.date.tomorrow("Do MMMM YYYY") %> and when I hit Ctrl + R to "replace templates in the active file" it executes the command, but I cannot go back and re-edit the command without hitting Ctrl + Z to undo (which doesn't help me because I'm trying to edit templates from many months ago).

I would like a command that makes it so I can go back and re-edit the commands, instead of having to rewrite everything again.

Thanks

@DVDKAY DVDKAY added the enhancement New feature or request label Jan 21, 2025
@Zachatoo
Copy link
Collaborator

Templater doesn't store any information about what commands existed before the template was executed. There is no way to know what the Templater commands were if they aren't in the editor history (CtrlZ). I can't think of a good place to store that information in a way that is backwards compatible and robust.

If you don't have backups, you'll unfortunately have to recreate those templates.

@fronglemog
Copy link

@DVDKAY
If you want your templates to still exist after executing them, you need to create your template in another note; for example in "Templates/Date - tomorrow.md".

Then use the command "Templater: Open insert tempate modal" to select and insert the template into your current note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants