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