 [ ← blog / drupal ](/) Jan 25, 2014  ·  \#drupal  ·  4 min read 

# Sublime Text 2: Drupalized



For quite a long time I used [Aptana](http://www.aptana.com/) as my development IDE; but, as time went on I found it quite bloated and extra features I didn't need. So I gave Sublime Text a try since it's all the rage by those who use it. Sublime Text is amazing because it's so simple, yet extendable. At first I was put off by a few things so I figure I'd share my setup and packages to turn Sublime Text into your IDE powerhouse!

First off visit <http://www.sublimetext.com/> and download the program - it's available on Linux (I run Ubuntu), Mac, and Windows. Technically this is a paid program, but if you do not purchase a license it just harasses you after 6 or 7 saves with a "Hey, Purchase Me" nag. (Which, I recommend purchasing, devs did a great job.)

Second - get Package Control! This allows you to browse and install packages (via Git channels) through the program itself. Load up Sublime Text and open the console: *cntrl/cmd+&#96;*  or *View -&gt; Show Console.* Paste the following into your console to setup Package Control.

> import urllib2,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed\_packages\_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install\_opener( urllib2.build\_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( '<http://sublime.wbond.net/>' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')

Close and reopen Sublime Text. For full instructions (aka the original page, there isn't much else to do) <https://sublime.wbond.net/installation#st2.&nbsp>;

To install packages use the shortcut *shift + cntrl/cmd + p* and a Sublime Text context menu will open. Start typing "Install Package" to search through the options available. Either hit enter or click on "Package Control: Install Package." I'll quickly name off the packages I have installed and a brief description. If you want to learn more about each package, the title will be linked to the repo's homepage.

- [SideBarEnhancements](https://github.com/titoBouzout/SideBarEnhancements) - Improves the sidebar to reflect a typical IDE.
- Git and [SideBarGit](https://github.com/SublimeText/SideBarGit) - Adds built-in Git handling and exposes Git commands through sidebar.
- [BracketHighlighter](https://github.com/facelessuser/BracketHighlighter) - easier identification of brackets
- [Emmet](http://emmet.io/) - Ridiculous autocomplete and shortcuts for CSS.
- [Sass](https://github.com/nathos/sass-textmate-bundle) and [SCSS](https://github.com/MarioRicalde/SCSS.tmbundle) - I use Sass, provides better syntax handling and autocomplete.
- [Drupal](https://github.com/robballou/drupal-sublimetext) - Tada! Enables Drupal API autocompletes, recognition of .info files as a syntax.
- [DocBlockr](https://github.com/spadgos/sublime-jsdocs) - makes documentation code a bit easier

Now, time to tweak your settings. Go to *Preferences -&gt; Settings - User.* This will enable some time saving features: trim whitespace, EOL at end of file, spacing, rulers (because things should go over 80 columns, technically. You can checkout[ my config as a Gist](https://gist.github.com/mglaman/8628332), but you merely need to add the following:

> "default\_line\_ending": "unix",  
> "draw\_white\_space": "all",  
> "ensure\_newline\_at\_eof\_on\_save": true,  
> "rulers":  
> \[  
>    80  
> \],  
> "shift\_tab\_unindent": true,  
> "tab\_size": 2,  
> "translate\_tabs\_to\_spaces": true,  
> "trim\_automatic\_white\_space": true,  
> "trim\_trailing\_white\_space\_on\_save": true,  
> "use\_tab\_stops": true,  
> "word\_separators": "./\\\\()\\"'-:,.;&lt;&gt;~!@#%^&amp;\*\|+=\[\]{}&#96;~?"

There ya go! You should be all set and ready to rock 'n' roll. Apparently someone has created a shell script to do all this for you: <https://github.com/enzolutions/sublime-drupal>. But, this article was geared for people new to Sublime Text, or new to development in general.

 

  ![](/themes/custom/mglaman/images/headshot.webp)Thanks for reading

I write about Drupal, PHP, and the quiet infrastructure behind large sites — caching, config, and testing. New posts land every week or two.

 [Subscribe via RSS →](/rss.xml) [About me →](/about-me) 

 



 

  [← Older

Bing VS Google: Uninstall autocomplete

 ](/blog/bing-vs-google-uninstall-autocomplete) [Newer →

Gettin' Responsive: Using Omega 3 and Omega 4

 ](/blog/gettin-responsive-using-omega-3-and-omega-4)