Over the years, I have tried many text editors and Sublime Text 2 has been by far the best of the lot. This article contains some of the Sublime Text 2 packages that I found to be very useful for web development.
I have been using Sublime Text 2 for over a year now and it is without any doubt the best cross platform text editor out there. There are other editors that I use depending on the platform such as Notepad2 on windows and nano on Linux (without a GUI).
When I am working on any .NET project, Visual Studio 2012 is my IDE of choice, but for everything else I fall back to sublime. You might be wondering why am I comparing a text editor to an IDE. Well, you’d be amazed by the power and speed of sublime text 2 and it is expected to get even faster when Sublime Text 3 is released. I like it so much that I even use it for writing my blog posts. I can totally understand why almost all who use it just fall in love with it.
Before I get into the fun and interesting stuffs, first things first.
Getting Sublime Text 2
Windows and Mac users can download and install sublime text 2 from here. If you use Ubuntu, you can install it via the following PPA.
sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text
Once you have installed sublime, you must definitely get the Sublime Package Control. It will help you in discovering, installing, updating and removing sublime packages very easily.
Install Sublime Package Control
Follow instruction on the Sublime Package Control website or follow the steps below. Open Sublime Text 2 and press Ctrl + ` or select View → Show Console from the Top Menu. The Sublime Text 2 console will appear at the bottom of the screen as shown below.
Paste the following code and press Enter / Return key.
import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish installation')
Restart sublime to finish installation. Now press Ctrl + Shift + P to open the command palette as shown below.
Start typing install package. You should be able to see the Install Package option of the package control as shown below. If you see the option that congratulation on having successfully installed the Sublime Package Control.
Option 1: Using the Package Control (Recommended)
Open the command palette by pressing Ctrl + Shift + P. Select the Package Control: Install Package option on the palette or click it. The Package Control will fetch the list of available packages from the internet and display it in a new palette as shown below. You can select any package that you want and just press enter. Sublime Package Control will install the package for you.
Option 2: Manual Installation
You can manually download any sublime package and copy it to the Packages folder to install and enable it. To open your Sublime Text 2 packages folder, select Preferences → Browse Packages... from the top Menu Bar.
List of Useful Sublime Text 2 Packages
Anyways, enough of the boring stuff. Without any further delay, here’s some out of the many, many sublime packages that I use. All of the packages below can be intstalled via the Package Control.
- Soda Theme – I just love the dark theme.
- Base16 Color Scheme – A brilliant color scheme for sublime (among others).
- ApacheConf – Syntax highlighter for Apache configuration files.
- BracketHighlighter – Highlights matching brackets
- Clickable URLs – Highlights and makes URLs clickable.
- DetectSyntax – Automagically detects the best syntax highliter to use.
- FileSystem Autocompletion – Autocompletes files names on you system.
- Git – Use GIT right inside Sublime Text 2.
- HTML5 – Syntax highlighting for HTML5.
- HTML Attributes – Autocomplete HTML attributes.
- HTML Tidy – Clean and reindent HTML.
- SCSS – SCSS syntax highlighter.
- SideBarEnhancements – Adds additional options to manage sidebar folders.
- Surround – Adds commands to modify text arround selection.
- LaTeXTools – Yes LaTeX. Simplifies working with LaTeX projects and files.
One of the best features about Sublime Text 2 is that almost everything is configurable via the settings file. Below is my current user setting file.
"color_scheme": "Packages/Base16 Color Schemes/base16-monokai.dark.tmTheme",
"theme": "Soda Dark.sublime-theme",
I hope this article helps to to configure sublime and get you more productive at work. If you are new to sublime and want to know more about it you should start at the sublime text website. Once you have decided to use it as you text editor, you might as well learn a few keyboard shortcuts or watch some sublime text 2 videos. Finally advanced uses might wanna look at some configuration options.