Sublime Text Tricks


2013-09-25

I wouldn't say these are really tricks, but they're definitely things you want to know about if you use Sublime Text 2 as your text editor -- especially for software or web development. I'll be adding any additional things I find/configure about Sublime Text.

Opening new files in an existing Sublime Text window
I split my time between Mac OS and GNU/Linux. By default, Sublime Text 2 opens new files in a new editor window on Mac OS. I'm not sure why this is the default, since it doesn't do this in Ubuntu (or in Windows, I think). To make Sublime Text open new files in the same window you're already using, you need this in your settings:

// OS X only: When files are opened from finder, or by dragging onto the
// dock icon, this controls if a new window is created or not.
"open_files_in_new_window": false,

I usually just edit the default preferences, in which you'll only need to change that from false to true.

Goto Anything, Projects, and Samba
I used Vim for a little while and got hooked on a Control+P bundle that fuzzy searches your project for any file name. I'm not sure if Sublime Text, Vim, or some other editor debuted this quick fuzzy-match/Goto Anything/Project search funtionality, but you'll definitely want to take advantage of it. I thought that I couldn't use Goto Anything with Sublime Text 2 because I was editing files that reside on an Ubuntu VM, but one of my co-workers informed me that opening the project directory in Sublime would allow me to use the feature. Just drag the folder that holds all of your project files to Sublime Text 2 and Ctrl+P will now search that entire folder.

I make this even easier by saving the set up as a sublime project (Project>Save Project As). This means I can open Sublime Text 2, open my project.sublime-project file and get to work.