3

Has anyone successfully gotten EE tags to properly highlight in Sublime Text 2? I tried installing the default ExpressionEngine package available from the package installer and it doesn't do anything. I also tried this one https://github.com/mrw/ExpressionEngine2-Sublime-Text-Bundle and it throws errors when I launch it. Any suggestions?

I am running OSX 10.8.2 and Sublime Text 2.0.1 (trial)

  • I'm using the ExpressionEngine package that's from github.com/Etsur/EE-ST2 and it's working great for me, is that the 'default' you're talking about? Your color theme may also have something to do with it. – Jacob Russell Jan 12 '13 at 21:00
  • This might be obvious but have you switched the document type to ExpressionEngine in the bottom right of the window? It doesn't automatically pick up that what you're working on is EE template code, you have to tell it which highlighting rules to use. – foamcow Jan 12 '13 at 21:18
9

I don't know if you're using the Monokai colour scheme, but if you are you'll need to hack it to make the EE tags go purple - just add the word 'constant' on line 96 of ~/Application Supprt/Sublime Text 2/Packages/Color Scheme - Default/Monokai.tmTheme like this:

where to fix EE sublime syntax highlighting

The end result should look like this:

EE tags in purple

Edit to add that I'm now using the Spacegray Eighties theme which I prefer a bit. However by default the EE tags will be a very similar orangey red colour to any HTML markup. To improve that and turn the EE tags blue you need to edit line 240 of base16-eighties.dark.tmTheme to change the color of the 'Constants' entry to #6699cc - The end result would then look like this: Spacegray Eighties with improved EE tags

Further edit to add that in ST3, the path to the file you need to change is now ~/Library/Application Support/Sublime Text 3/Packages/Theme - Spacegray/base16-eighties.dark.tmTheme ... Alternatively you can install Package Resource Viewer to get there directly in ST: https://github.com/skuroda/PackageResourceViewer

| improve this answer | |
  • 1
    I see that this works. I'm using the Monokai Bright theme and the same thing applied now shows the EE tags in purple. – foamcow Jan 12 '13 at 23:39
  • Any one get this working with the Monokai Soda Theme? I found a simlar line of code in MonokaiSoda.tmTheme on line 80 and added: <string>constant,constant.character, constant.other</string>. Still Not highlighting EE tags properly, with the EE Sublime Text Bundle. Soda-Theme is a good looking theme/skin for sublime text 2. – Shan Ricciardi Jan 14 '13 at 4:39
  • 2
    I have it working with the Soda theme too - The thing is, the 'theme' and the the 'color scheme' are two different things... To make the change described above on a mac you need to go to ~/Sublime Text 2/Packages/Color Scheme - Default/Monokai.tmTheme – James Smith Jan 14 '13 at 8:20
  • My mistake - Soda theme has two optional color Schemes. Monkokai-Soda and Expresso Soda . I have it working with Monkokai-Soda Color scheme now. Thanks – Shan Ricciardi Jan 14 '13 at 17:39
0

All of the ExpressionEngine tmbundle's derived from Tim Kelty, including the repo linked to in the question should contain the scope text.html.ee which can be targeted by adding a node inside the theme array:

    <dict>
        <key>name</key>
        <string>Expression Engine</string>
        <key>scope</key>
        <string>text.html.ee</string>
        <key>settings</key>
        <dict>
            <key>fontStyle</key>
            <string />
            <key>foreground</key>
            <string>#c6b1ed</string>
        </dict>
    </dict>

Optionally, you can add a background key/pair and/or target specific scopes. Additional scopes are found as string values in https://github.com/mrw/ExpressionEngine2-Sublime-Text-Bundle/blob/master/Syntaxes/ExpressionEngine.tmLanguage

I also find the sublime plugins ColorPicker and ColorSchemeEditor helpful in editing themes.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.