Adjective: Of such excellence, grandeur, or beauty as to inspire great admiration or awe.
This is not going to be a “Why Sublime Text 2 is better than <insert your preferred editor here>” post. But the pure awesomeness of Sublime Text 2 will make your current editor look like a chump. A very slow chump.
Hopefully this post will serve as a guide to give anyone wanting to try Sublime Text 2 instant gratification. Let’s go…
1 — Get It!
2 — Package Control
Any editor worth its salt supports a vast array of add-ons and plug-ins. Sublime Text 2 is no different. A full-featured package manager is available that helps managing and discovering new packages.
To install Sublime Package Control open the Sublime Text 2 console (^`) and paste the following code into it.
Once you’ve restarted Sublime Text 2 you are ready to install some packages.
Open the Command Palette (⌘⇧P) and begin typing Package Control to see a list of available commands. Select the Package Control: Install Package option and press ⏎.
Use your arrow keys or start typing to find packages to install. Once you found a package press ⏎ to install it.
Here’s a list of great packages to get started with:
- Nettuts+ Fetch
- Rails Related Files
- RSpec (snippets and syntax)
All of the above packages can be installed via Package Control with the exception
of Ruby-Slim. To manually install Ruby-Slim, or any other package, just
clone the repo into the
3 — Making It Pretty
Although some UI improvements have been made, Sublime Text 2’s default UI is still fuggo.
- Start the beautifying process by installing the Soda UI Theme via the Package Manager.
- Open your preferences file,
Preferences > Settings - Useror by using the ⌘, shorcut.
- Activate Soda Theme by either adding
Soda Dark.sublime-themeto your settings file.
1 2 3
Sublime Text 2 ships with an alright-ish set of color schemes, but everyone has their
preference. My personal favorite is Solarized.
To install it, simply clone the textmate-solarized
repo into the
Once installed, activate it under
Preferences > Color Scheme > Solarized or
add it to your preferences file.
1 2 3 4
All of this will make your editor look… Sublime!
If you prefer light colors, here’s Sublime Text 2 with Soda and Solarized Light.
4 — Command-Line Setup
To open files and folders from your command-line you need to add Sublime Text 2 to your path.
To make it easier to edit directly from your current directory, add the following alias.
6 — Notable Features
The Command Palette is an interactive list of all the commands available to Sublime Text 2. Whether you need to visit a Preferences page, or paste in a snippet, all of that can be done here. The Command Palette can be accessed by the ⌘⇧P key binding.
Giving you quick access to your files, the File Palette also lets you quickly jump to methods, functions or even markdown headings. Access it with ⌘P and after typing the file name, type @ to jump directly to a method in that file without even opening it. You can also use the ⌘R key binding.
You can also use : in the File Palette to jump to a specific line number in the current open file, or use the ^G binding.
Although vertical selection is nothing new, Sublime Text 2’s multi-selection takes it to another level. You effectively have multiple cursors on a single page.
To enabled multi-selection, you have the following options:
- Hold down ⌘ and then click everywhere you require a cursor.
- Select a block of lines and then press ⌘⇧L.
- Place the cursor over a word and press ⌘D repeatedly to select additional occurrences of that word.
- Alternatively, pressing ⌘^G will select all occurences of that word.
Simply, a MUST have! By pressing a few keys you can quickly split your screen.
Columns: 2 ⌘⌥2
Rows: 2 ⌘⌥⇧2
Grid: 4 ⌘⌥5
Are you a Vim Ninja? Then you are in luck. Sublime Text 2 has a Vintage Mode setting that will allow you to use the Vi commands you can’t code without.
To enable Vintage Mode make the following change to your preferences file.
1 2 3 4
After a quick restart, press ⎋… Bam! Command mode!
To take full advantage of Vim’s command-line mode you will need to install the VintageEx package. After installing it, just press : to open the Vim command-line.
To see all the implemented commands, just look through ex_commands.py.
5 — Customising Settings
For all settings, Sublime Text 2 has at least two files… Default and User. You can edit any of these files, but it is recommended to edit the User setting files.
- Settings - Default This file contains all the settings to configure Sublime Text 2. It can also serve as a great reference.
- Settings - User This is where you can override the defaults to better suit your own needs.
- Syntax Specific - User Allows you to configure settings for specific file types, like applying a ruler to markdown files.
- Key Bindings Key bindings… Move along.
Here are some basic settings to get you started.
As noted by a friend, “Sublime Text 2 made it to version 2 stably”. Even in its current state Sublime Text 2 surpasses most “stable” editors out there, and it did not require everyone to wait years for a major version bump.
When it comes to choosing a text editor, all developers have their own preference and favorite. I feel that Sublime Text 2 bridges the gap between hardcore code wrangling and an editor with a slick user interface.
Give Sublime Text 2 a try! You have nothing to lose and everything to gain.