By josh / November 20, 2012

How to fine tune your environment with Sublime’s project-specific settings

Text editors are very personal, and if you’re like me, you probably have a favorite set of configurations that you’ve refined and honed through hours of fiddling and experimentation.

But writing software is a team effort, and with each new team member comes a different set of preferences. It’s galling to have to modify your default settings just because the other guy on the project likes to indent code with four spaces instead of two.

Wouldn’t it be great if your text editor just knew the right settings to use and you never had to remember to change them yourself?

Sublime Text doesn’t read your mind or your mood, but its project files just might be the next best thing.

If you’ve been working with Sublime Text for a while, you’re probably aware of Sublime’s projects and how they let you save and restore the project-related folders you have open in the sidebar.

But you can also use project files to tweak your working environment by overriding any of Sublime’s hundreds of settings. Settings overridden in the project file are only in effect when you’re working on that specific project.

Right now I’m using this feature on my own projects to make my prose writing more enjoyable. (Yep, I use Sublime for prose as well as code. I’m using it right now, in fact.)

I’m picky about manually formatting my code, and my default settings are optimized for coding:

  • Text wrapping disabled
  • Ruler at 110 characters as a line length guide
  • Line numbers enabled
  • Dark color scheme with vivid colors for syntax highlighting

For prose, I use the MarkdownEditing plugin, which includes a nice gray-on-white color scheme with subtle Markdown syntax highlighting. It also puts wide gutters on either side of the text, allowing it to flow in a narrow column down the center of the screen.

I usually enable Sublime’s Distraction Free Mode, and the less editor chrome I have to look at, the better I like it. I also don’t want to have to manually wrap lines because Markdown tags can’t be split across lines.

To make this dream writing environment a reality, I’ve customized the project file I use for my ebook and blog to override some of my code-friendly defaults.

Now when I’m writing prose, I have:

  • Text wrapping enabled
  • No ruler
  • Line numbers disabled

And when I go distraction free, there’s nothing to take my attention away from the words on the page.

If you’re interested in seeing an example of a customized project file, here’s a gist of my Sublime writing file.

The example also shows how to include multiple root folders, as well as how to hide files and folders that you don’t want to show up in the sidebar.

Did you find this helpful? There’s a lot more available here:

About the author


Click here to add a comment

Leave a comment: