Can i add date time for sublime snippet?

Tools > New Plugin Paste this: import datetime, getpass import sublime, sublime_plugin class AddDateCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.run_command(“insert_snippet”, { “contents”: “%s” % datetime.date.today().strftime(“%d %B %Y (%A)”) } ) class AddTimeCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.run_command(“insert_snippet”, { “contents”: “%s” % datetime.datetime.now().strftime(“%H:%M”) } ) Save it as ~/Library/Application Support/Sublime Text 2/Packages/User/add_date.py Then, in Preferences > Key Bindings – … Read more

Sublime Text 2 / Sublime Text 3 bring back unsaved files on osx

Sublime Text 2 stores the files in ~/Library/Application Support/Sublime Text 2/Settings, in the .sublime_session files that are located there. The contents of those files are a large JSON blob that contains the individual tab contents. Search in the file for the file name / tab name / a key word in the document and you … Read more

How to use dollar signs/JQuery with Sublime Text 2 Snippets?

Did you try escaping the $ with a \? For instance in PHP, the $GLOBALS snippet is: <snippet> <content><![CDATA[\$GLOBALS[‘${1:variable}’]${2: = }${3:something}${4:;}$0]]></content> <tabTrigger>globals</tabTrigger> <scope>source.php</scope> <description>$GLOBALS[‘…’]</description> </snippet> As you can see in <content>, $GLOBALS is expressed as \$GLOBALS. This is because $ is a symbol used for fields like ${1:variable}.

How to stop lines of code from automatically shifting to the next line whenever I resize the window of the editor?

Look in the default Preferences.sublime-settings file for the setting below: // Disables horizontal scrolling if enabled. // May be set to true, false, or “auto”, where it will be disabled for // source code, and otherwise enabled. “word_wrap”: “auto”, If you want the default for word wrap to be off for all syntax types: Copy … Read more

tech