

This is by far one of the more confusing parts of the article, but bear with me, it’s in your best interest. You will see these parameters mentioned throughout the API, so take note as you will be using them again. “Self” is our default sublime object and “edit” is the edit token which allows our interaction with ST3 through Python. You’ll notice two parameters being passed: def run(self, edit): For my project, I also needed some others for handling time, json objects and url parsing.Īt this point you should also take a moment to look at the default “run” method being created. These two imports are required for interaction with ST3 and will be the object that you perform interaction with when using the ST3 methods defined in the documentation. These declarations go at the beginning of your plugin and you will see two of them already there: import sublime They are how you include other code libraries to perform tasks that you don’t want to manually write on your own. Net or other similar languages, you will be familiar with imports. I also recommend downloading package control and a decent Python Linter to help you troubleshoot easy errors. Fortunately, ST3’s syntax highlighter is very helpful in this regard. Knowing the above will help you clear syntax hurdles faster, especially if you are used to developing in PHP or other, more forgiving languages.

Semi-colons at the end of lines are not required but can be used to place several commands on one line.Indentation is used for classes and functions, no.DO IT NOW.īefore we get into modifying the Python code that makes up our plugin, let’s be clear on a few things:

If you haven’t read Part 1, please do so or most of this won’t make sense. Thanks for joining me for Part 2 of this series.
