Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Sublime Text

You're reading from   Mastering Sublime Text When it comes to cross-platform text and source code editing, Sublime Text has few rivals. This book will teach you all its great features and help you develop and publish plugins. A brilliantly inclusive guide.

Arrow left icon
Product type Paperback
Published in Dec 2013
Publisher Packt
ISBN-13 9781849698429
Length 110 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Dan Peleg Dan Peleg
Author Profile Icon Dan Peleg
Dan Peleg
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Mastering Sublime Text
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Installing Sublime Text FREE CHAPTER 2. Code Editing 3. Snippets, Macros, and Key Bindings 4. Customization and Theme Development 5. Unravelling Vintage Mode 6. Testing Using Sublime 7. Debugging Using Sublime 8. Developing Your Own Plugin Index

Starting a plugin


Sublime can generate a plugin template for us. To generate a plugin, navigate to Tools | New Plugin…. Then we should see a screen similar to that shown in the following screenshot:

The previous screenshot is what a "Hello, World!" plugin looks like. Before starting to write our own code, let's test the following code by saving the file by pressing Ctrl + S on Windows or Linux and Command + S on OS X. The Save dialog will open in the Packages/User folder. We don't have to save the file there. We will browse one folder up and create a new folder named RelationsFinder. Now let's save the file as RelationsFinder.py. The filename doesn't really matter, but the convention is that the file name should be the same as the plugin name. After we've saved the plugin, let's try running it. To run the file, we'll need to open the console by pressing Ctrl + ` on Windows or Linux and Control + ` on OS X. Enter the following line in the console to test your new plugin:

view.run_command('example...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime