Creating Your First TermStudio Plugin
// Creating the Plugin Manifest
Create a directory for your plugin and add a manifest file manifest.json:
{
"id": "wordcounter",
"name": "Word Counter",
"version": "1.0.0",
"entry": "main.py"
}
// Writing the Plugin Code
Create the entry file main.py to calculate words and update the status panel:
def initialize(api):
def update_words(editor):
text = editor.get_text()
count = len(text.split())
api.status_bar.set_text(f"Words: {count}")
api.on_text_change(update_words)
// Testing the Plugin
Put your plugin directory inside the user's plugin folder and restart TermStudio. The status bar will now display word count updates in real time.