Neal Sheeran

Rants, Raves, and Geekery

My Sublime Text 2 Setup

Permalink

Consider this my obligatory Sublime Text 2 post. ST2 has become my editor of choice (over BBEdit, among others) based on how powerful it can become through the use of plug-ins. Here a few of mine that I find useful.

FileDiffs

Package to quickly find the differences between two files with a user-defined keyboard shortcut. Normally, a new tab will open that identifies the changed lines. I have actually turned this off because the awesome aspect of this plug-in is the ability to set up an external diff tool. I use the not-cheap, but excellent Kaleidoscope. When I select Shift-Ctrl-F, and choose what I want to compare the open file to, Kaleidoscope opens immediately with much better visual indications of what exactly has changed. Very useful. 1

MarkdownEditing

Standard Brett Terpstra greatness for writing Markdown in Sublime Text. Auto-pairing of Markdown characters, keyboard shortcuts for pasting Markdown links, and a special color scheme just for Markdown files. Also recommended if you are a Marked user is the Marked Bonus Pack, which includes a Sublime Text Build System to quickly preview a Markdown file in Marked. If you are not a Marked user, well… see the next tip, but you should really get yourself checked out.

Markdown Preview

A very simple package that gives some nice Markdown preview options, in a browser window or a new tab with generated HTML. I use Option-m for the former, and it is quite fast.

SmartMarkdown

Have your cursor sitting in a Markdown header? The Tab key will fold all the text beneath that header. Shift-Tab will fold all the headers in a document, regardless of where your cursor is. There are also shortcuts for navigating through different headers and increasing/decreasing their level.

SCSS

Write Sass? This gives you syntax highlighting for .scss files. Another somewhat-related tip: I use Bryan Jones’ excellent app, CodeKit to generate all my Sass files. CodeKit also has its own Kit language to create HTML partials. In order to get .kit files to have HTML syntax highlighting, go to the HTML package in the Package directory and find the HTML.tmLanguage file. In the fileTypes array near the top, add this line: <string>kit</string>. Done.

PlainTasks and SublimeTODO

Two excellent plug-ins for managing projects in Sublime Text 2. I wrote about them here.

Git, SideBarGit and Git Gutter

All great plug-ins for integrating git into Sublime Text. I especially like Git Gutter. It adds small symbols in the gutter that indicate added/deleted lines since the last commit.

Origami

Keyboard shortcuts for creating new editor panes and sending documents back and forth between them. The keyboard shortcuts take a bit to become second nature, but definitely worth it.

ReadmePlease

After you have installed all these plug-ins, use this one to quickly get access to any installed plug-in’s README file.

Themes and Color Schemes

I have to yet to find the perfect theme for ST2, but currently I’m running the Flatland Dark theme, along with its color scheme. Phoenix is another great theme with a lot of options and more often than not I find myself using the dark version of the default Solarized color scheme.

My current User Preferences file is in a Gist here 2, and if you are new to Sublime, this free screencast series at Tuts+ is excellent.

  1. I followed the directions to use Kaleidoscope with the plug-in here, but the app would not open. I believe with Kaleidoscope version 2, the app now places the command line utility ksdiff in /usr/local/bin. In my FileDiff User Settings file, I had to explicitly set the path to ksdiff as follows: "cmd": ["/usr/local/bin/ksdiff", "$file1", "$file2"], rather than creating a symlink to usr/bin as described in the wiki.

  2. Spaces, not tabs. Two of them.

Comments