Last updated December 30, 2015. Created on November 19, 2011.
Edited by vzsigmond, TheodorosPloumis, griz, Elaman. Log in to edit this page.

Sublime Text is a sophisticated text editor for code, html and prose. You'll love the slick user interface and extraordinary features.

Sublime Text is available for OS X, Windows and Linux.


screenshot sublime text


For linux and mac users there is a script to auto configure your sublime at Sublime Drupal.

Go to "Preferences" => "Settings - User" and change the following settings:

  "rulers": [80],
  "tab_size": 2,
  "translate_tabs_to_spaces": true,
  "use_tab_stops": true,
  "trim_automatic_white_space": true,
  "trim_trailing_white_space_on_save": true,
  "ensure_newline_at_eof_on_save": true,
  "fallback_encoding": "UTF-8",
  "default_line_ending": "unix",
  "shift_tab_unindent": true,
  "word_separators": "./\\()\\'-:,.;<>~!@#%^&*|+=[]{}`~?"

Enabling whitespace characters

Optionally, you could also add a setting to view whitespace characters to the end of the code settings (found above):

"draw_white_space": "all"

Useful plugins

  • Sublime Drush: A plugin that provides integration with Drush 6 for Sublime Text 3.
  • Goto Drupal API: A command to jump to the documentation for the current word.
  • Go to Documentation: A command to jump to the documentation for the current word. Supported languages include PHP and Javascript.
  • Drupal Sublime text: A package for Drupal snippets, autocomplete support, and info file syntax highlighting for Sublime Text.

Other resources

Looking for support? Visit the forums, or join #drupal-support in IRC.


mdixoncm’s picture

Not strictly Drupal related, but here is a helpful step by step for setting Sublime up for PHP editing ...


This is also super handy - out of the box the double click to select won't select dollar signs, a real pain for copying PHP variables ... this post will sort that out

r.vazquez’s picture

I created a Stack on Delicious that I am constantly updating as I find helpful links for developing on ST2. You can check out the links here. You will find 15 links (as of today) going through everything from the benefits of Sublime over other IDE's to Drupal-specific packages available for download.

Ricardo Vazquez
Myplanet Digital

omissis’s picture

I am also using additional, per-project config for phpcs:

  "settings" :
    "phpcs" : {
        "extensions_to_execute": ["php", "inc", "module"],
        "extensions_to_blacklist": ["Test.php"],
        "phpcs_additional_args": {
            "--standard": "Drupal"
        "phpmd_run": true

danylevskyi’s picture

sebby’s picture


This configuration is using on my sublime settings and the list of plugins is great.

rokr’s picture

There is an updated version for Sublime Text 3 now:

computerbarry’s picture

Thats great, though Sublime Text 3 not available if you're running Mac OS X 10.6.8 :(

The more you learn.... the more you learn there is more to learn.

Elijah Lynn’s picture

This article needs codesniffer + Drupal instructions added. If someone has time they should update it with the instructions at the Reality Loop link that Rokr posted above.

The Future is Open!

raskolbasster’s picture

And some tutorials for the begginer in the sublime text 2

RaulMuroc’s picture

colorsand’s picture

how to recognize drupal file extension like .install, .modules, .inc as php ?

kendallsv’s picture

in latest version of SLT 2 and 3 you just need to open the file and then hit on the bottom-right corner that could say txt or html and then go to the first option that say: Open all with current extension as... and then just choose php or the one you need

thomas salah’s picture


Very useful tutorial but keep in mind that using it as it is, it will add a lot of white lines and spaces to your code.

This makes it very difficult to read a commit on github as you now cannot only see the code added by the developer.

To stop this behaviour, intsead of "trim_trailing_white_space_on_save": true, change to "trim_trailing_white_space_on_save": false,

sandorczettner’s picture

Coding standard fixes should be a separated commit. So first commit the fixes (and blame the other developer not following standards) then do your changes.

mchar’s picture

This line "word_separators": "./\\()\\\'-:,.;<>~!@#%^&*|+=[]{}`~?" and especially this "\'" throws "Invalid escape...sublime-settings: 12:22"

vzsigmond’s picture

There was an extra "\". Fixed.

Imaaxa-Cory’s picture

Just found this, and it works.

When you have the .module file open, go to:

View -> Syntax -> Open all with current extension as

and select PHP. This will then default all .module files to use PHP syntax.

Posted by: KyleTaylored on