I’ve decided to write some amazing applications in Python this year. Sublime Text (ST) is my favorite editor, known for its clean interface, speed, and cool plugins. As such ST isn’t an IDE (Integrated Development Environment), however plugins are available to turn it into one (perhaps even better!).
ST3 can be downloaded from its official site. Note that the unregistered ST3 doesn’t have any expiration date and I recommend you to buy the license. It’s truly worth it.
The first thing is to install the Sublime Package Control which is a package management plugin for ST. To do that open the console of ST (Ctl+`) and paste the following code and hit enter.
import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
Restart the ST and keybording Ctl+Shift+P should open up the Command Palette. And type install to get a list of the plugins.
Here are a list of few best known plugins (I’ll be adding more as I discover the new ones).
- SublimeCodeIntel : A smart, context sensitive autocomplete plugin.
- SublimeLinter: A linting framework for linting plugins. A linter is a small program that checks code for stylistic or programming errors. Programming is hard. We are bound to make mistakes. The big advantage of using SublimeLinter is that your code can be linted as you type (before saving your changes) and any errors are highlighted immediately, which is considerably easier than saving the file, switching to a terminal, running a linter, reading through a list of errors, then switching back to Sublime Text to locate the errors!
- Pyflakes and Pep8 : SublimeLinter is a framework for ST3 linters. The package itself does not include any actual linters; those must be installed separately via Package Control using the SublimeLinter-[linter_name] naming syntax. For Python linting I use Pyflakes and Pep8.
- Emmet : Intelligent code substitution and expansion plugin
- Bracket Highlighter : Matches a variety of brackets such as:
#!xml <tag></tag>, and even custom brackets.
- Sidebar Enhancements : Provides enhancements to the operations on Sidebar of Files and Folders.