#The Joy of Coding a Simple Plugin
Rob Smith on August 30, 2013 with 48 Commments
Tutorial Details
Program: Some programm
Version: 2.0
Difficulty: Beginner
Estimated Completion Time: 45 minutes
In this tutorial, I'll show you you a way to create a really simple plugin that is both a simple and amazing plugin. We'll cover theses basics:
- Plugin programming language (Python)
- Snippets
- Settings files
Coming from a Java-based editor, I'm impressed with the blinding speed of Sublime Text. Curiously, there is currently no enforced time limit for the evaluation. Once in a while, you'll get a message encouraging you to register, but the software continues to work perfectly.
The TOP 5 reasons to create your own plugin
- With a basic knowledge, you can easily customize existing plugins to your needs
- For small specific tasks, like the one you're about to learn, a larger plugin can be "too much" and get in your way
- You may find that with just a few lines of code, you will create a plugin that you'll use every day
- It's fun
- It's fun!
Let's get crazy bullets:
-
This is a list item with two paragraphs. Now is the time for all good ment to come to the aid of the party.
This paragraph is part of bullet 1, since it is indented. Now is the time for all good ment to come to the aid of the party.
-
And finally, this is last bullet in list.
TIPx
This is intended and an important tip.
The above header should be an H2 tag. Now, for a list of fruits:
- Red Appples
- Purple Grapes
- Green Kiwifruits from France.
Here is some programming code:
import sublime
import sublime_plugin
import datetime
class ToDoDateCommand(sublime_plugin.TextCommand):
def run(self, edit):
d = datetime.datetime.now().strftime("%d %b %Y (%a)")
self.view.run_command("insert_snippet",
{"contents": "TODO ${1:yourname} - ${2:note} @ " + d })
test