DevOps Zone is brought to you in partnership with:

A friendly Finnish hacker. I am technology consultant, open source advocator and entrepreneur. My expertise areas cover HTML5, Python, Plone, Javascript, WebGL,UNIX and mobile web. Mikko likes sushi, Angry Birds and dislikes winter. Mikko is a DZone MVB and is not an employee of DZone and has posted 43 posts at DZone. You can read more from them at their website. View Full User Profile

Exporting and Sharing Sublime Text Configuration

05.09.2013
| 10735 views |
  • submit to reddit

Sublime Text is a very powerful and popular text editor. But it’s more than a text editor… it’s an ecosystem of programmer’s tools where you can go to armory and choose the winning set for every code you’ll face. However, entering this ecosystem is long walk; learning all the plugins, tricks and such will take time. In this blog post I’ll show how more experienced Sublime Text user can share his/her setup with fellow peers still learning Sublime Text. Also, I have created a shell script collection which helps copying configurations into a fresh Sublime Text installation.

Screen Shot 2013-05-09 at 1.21.35 AM

If you are new to Sublime Text 2 read my crash course article. Instructions in this blog post have been tested with Sublime Text 2. Sublime Text 3 is in beta, but it is not recommended yet for every day usage yet as some of the workflow critical plugins have not yet been ported for this version.

Sublime Text configuration mainly consists of following

  • Packages/ folder where all your installed plugins and setting files lie (shortcut into this available through preferences menu)
  • Packages/User/ folder where are the files specific to your configuration (other folders in Packages/ folder are pristine plugin files and should not be directly edited)
  • Packages/User/Preferences.sublime-settings stores the preferences you have changed
  • Packages/User/Package Control.sublime-settings containsthe list of installed addons

1. Configuration files needing copying

To transfer your Sublime Text configuration to fellow user you only need to copy

It is not safe to copy plugins as is between environments, as plugins may contain operating system or computer specific dependencies. It’s better to copy Package Control.sublime-settings file only. On the next Sublime Text start up Package Control will automatically read the list of packages from this file and install any missing packages from Github.

Manually installed packages, those not through Package Control, must be installed by hand on the target computer.

For personal backup purposes you can sync Sublime Text configuration using Dropbox.

2. Automated setups

I have created a sublime-helper, a collection of shell scripts, which will help copying Sublime Text configurations (hosted on Github). It comes with my own configuration andpackage list; please free to clone and do whatever you want it with to make your and your peers’ workflow smooth.

The script will also setup subl shell alias to open Sublime Text from command line. Also, your UNIX EDITOR environment variable will point to special subl-wrapper-wait-exitcommand which integrates Sublime Text for git and svn commit message editing.

I tested the script by transferring my Sublime Text 2 configuration from OSX to Ubuntu Linux. A person new to Sublime Text was able to configure the editor and grasp some basics in 5 minutes. After seeing SublimeLinter jshint warning highlighting and JsFormatplugins the test person reaction was: “Oh my god, oh my god, oh my god.”

I think he is not switching back to Aptana + Eclipse.

Screen Shot 2013-05-09 at 1.47.51 AM

Published at DZone with permission of Mikko Ohtamaa, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)