Plugin to add timestamp to sublime snippet.
- Copy all file to
Packages/User
directory of sublime text. - Configure sublime-snippet file as you want (
cpp_template.sublime-snippet
for c++ andpy_template.sublime-snippet
for python) - Now you can create a simple snippet and the date will be updated every time you press
command + s
.command + s
still has the function to save files.
-
Because snippet doesnot support dynamic variable, I use static variable
DATE
define inDefault.tmPreferences
and update this variable when we want to create snippet. -
I use a plugin (command)
updatetm
to updateDATE
inDefault.tmPreferences
. -
I want the date and time to be updated automatically or at least passive. So I added a function that called
updatetm
command for keystrockescommand + s
. To do this, I use another plugin ischain.py
to call multiple command on a keymap (bothupdatetm
command and the default command (save
). Keymap defined inDefault (OSX).sublime-snippet
file.