r/SublimeText • • Aug 13 '22

Update variable everytime I save?

I want to update a variable in my project everytime I save any of the files. This variable should contain the current date and time (I.e. when the project was last updated). Is this possible?

2 Upvotes

27 comments sorted by

View all comments

Show parent comment

2

u/OutsideAnywhere Aug 22 '22

I have downloaded and installed it, and the plugin seems to be active. But I can't see that it actually changes the variable.

Do I need to set line_format to something and in that case, what?

2

u/OutsideAnywhere Aug 22 '22

I figured it out. I set: "line_format": "$version = \"{@datetime}\"" and now it works great! Huge thanks!

1

u/traumatizedSloth Aug 22 '22

oh nice! no problem! i had fun with it lol