0% found this document useful (0 votes)
39 views1 page

01 Plugins Basics

The document discusses how to create plugins for the Sublime Text editor by placing Python files in the Packages directory and extending classes like sublimeplugin.TextCommand and sublimeplugin.Plugin to handle commands and events respectively. It notes that errors and prints will appear in the console for debugging plugins.

Uploaded by

Sarai Thomas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views1 page

01 Plugins Basics

The document discusses how to create plugins for the Sublime Text editor by placing Python files in the Packages directory and extending classes like sublimeplugin.TextCommand and sublimeplugin.Plugin to handle commands and events respectively. It notes that errors and prints will appear in the console for debugging plugins.

Uploaded by

Sarai Thomas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Home Download Buy Blog Forum Support

Plugin Basics
Sublime Text is extensible via Python. Extending is simply a matter of placing a python file under the Packages directory (For example C:\Documents
and Settings\ username \Application Data\Sublime Text\Packages\User).

Each python file within the Packages directory is automatically scanned for Plugins, and automatically reloaded when changed.

To make a command that may be bound to a key, placed in a menu, etc, simply create a class extending sublimeplugin.TextCommand and override the
run() method.

To make a plugin that receives notification of file load, save, etc, create a class extending sublimeplugin.Plugin, and implement one or more of the
event methods (onLoad, onPostSave, etc). Note that TextCommand and friends themselves extend from Plugin, and may receive events.

When developing plugins, all syntax errors and print statements are directed to the console (accessible via Ctrl+~).

Next step: Take a look at some of the examples, or have a look over the API reference.

You might also like