I’ve posted before about my ever-deepening love for this excellent text-editor-come-IDE, but I haven’t shared the specifics of my Sublime Text 2 configuration, so for the geeks out there, here’s the gazillionth post on this topic.
1. Install Sublime Text 2
Do what it says on the box. Nothing should go wrong. If it does, quit coding on Linux and use one of the other two supported platforms.
(That was a joke. I haven’t tested the Linux version, that’s all.)
2. Install Sublime Package Control
There’s a package for pretty much anything you might want to do with Sublime Text 2, but managing them manually can be a bit of a pain. Sublime Package Control looks after installing them for you, and automagically updates them – silently – in the background. (Unless you’re a control freak and tell it not to.)
The Sublime console method has worked flawlessly for me.
3. Install the Soda theme and syntax highlighting
Sublime Text 2 is pretty, but the Soda theme makes it prettier.
From the Tools menu, select Command Palette and find Package Control: Install Package. (You’ll do this for each upcoming package installation.)
Select Theme – Soda.
Almost done. Now, for pretty syntax highlighting, follow these instructions.
No pretty UI yet? Don’t worry, we’ll make that happen in the next step.
4. Update Sublime Text 2 preferences
Go to Preferences > Settings – User from the main Sublime Text 2 menu, and your user preferences file will open. It’s JSON-formatted and almost empty, which is confusing at first, but makes sense once you dig in. All of the options available to you are explained in Preferences > Settings – Default.
Here’s how I have mine configured (note the “theme” and “color_scheme” entries):
{
"auto_complete_commit_on_tab": false,
"auto_match_enabled": false,
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"drag_text": false,
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
"*.o",
"*.a",
"*.lib",
"*.so",
"*.dylib",
"*.ncb",
"*.sdf",
"*.suo",
"*.pdb",
"*.idb",
".DS_Store",
"*.class",
"*.psd",
"*.db",
"*.bak"
],
"find_selected_text": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS"
],
"font_face": "Source Code Pro",
"font_size": 10,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
],
"show_full_path": true,
"tab_size": 4,
"theme": "Soda Light.sublime-theme",
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
5. Install SublimeCodeIntel and sublimelint
Project-wide code completion, function tooltips and jump-to-declaration are provided by the SublimeCodeIntel package. Syntax error highlighting is provided by sublimelint. Install both using the method described above (be careful not to accidentally install similarly named packages). Both should work out of the box (on Mac OS X, anyway – on Windoze you might need to add interpreters to your PATH for sublimelint to work).
Update: I also install the VBScript package. Its code completion isn’t very smart, but then VBScript isn’t very smart either.
6. Configure “build” systems
I’ve already posted about how I use Sublime Text 2’s build system for PHP and JSON formatting.
7. Restart and get to work!
I’ve found that new themes don’t “take” fully until Sublime Text 2 is restarted. Your mileage may vary.