How to enable auto save in sublime
In recent days for small project, like working with only HTML CSS JS, I am using Sublime Text 2. Its really a great text editor and more powerfull for its advanced feature. Sublime has many plugins which is the real power of this text editor you know that. Today I will not describe its functionality. You may know that by reading others blog. But today I will tell you a great feature which you miss in sublime. Yes, that’s auto-saving. Perhaps you are trying to find out a plugin for that. I am also trying, but could not find any. But I found a great way to do that. These are just few lines of python codes. Using this code; sublime will save on every key stroke like JetBrains PhpStorm. To do this, open your sublime package directory. Then you will find an another directory named user. Move on there. Now create a file and named with Autosave.py. And paste this code into the file.
import sublime, sublime_plugin class AutoSaveCommand(sublime_plugin.EventListener): def on_modified(self, view): if view.file_name(): view.run_command('save')
You might need to restart sublime. That’s it :). You may find out on another way by changing Default Setings under preferences. Changing the value of “save_on_focus_lost” from false to true. Its also an amazing feature. But the differences between these tricks; for first save data when you are typing and the second one when you goes out of focus of your working window. Now its your choice which you prefer on.
Thanks Buddy. Letter see with you.