Skip to content

How to Upload on Save

fermino edited this page Jul 20, 2020 · 3 revisions

You can create a Sublime Plugin to upload your code on save!

Creating Plugin

  • Go to Tools > Developer > New Plugin

  • In the new plugin, paste the code below:

    import sublime, sublime_plugin, re
    
    class SaveAndDoStuff(sublime_plugin.EventListener):
        def on_post_save(self, view):
            x = view.file_name()
            extension = x[-3:]
    
            if (extension == "ino"):
                view.window().run_command('stino_upload')
  • Save the plugin in Packages folder

Observation: this plugin is generic and you can add more extensions to do what you want