Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hassanalami/f888279d8e82f3a75bc57deb220ce032 to your computer and use it in GitHub Desktop.
Save hassanalami/f888279d8e82f3a75bc57deb220ce032 to your computer and use it in GitHub Desktop.
Operator Tweaks - This makes all attributes italic in Sublime Text 3
  1. Install Package Resource Viewer
  2. Use the shortcut Ctrl+ Shift+ p, search for Package Resource Viewer: Open Resource
  3. Select the theme you are using, the file should have the extension thTheme
  4. Add the following:
    <!--
     Operator Tweaks
     This makes all attributes italic
    -->

   <dict>
     <key>name</key>
     <string>Italic HTML attribute names</string>
     <key>scope</key>
     <string>
         entity.other.attribute-name.html,
         entity.other.attribute-name.event.html,
         entity.other.attribute-name.class.html,
         entity.other.attribute-name.style.html,
         entity.other.attribute-name.id.html,
         entity.other.attribute-name.tag.jade,
         constant.other.symbol.ruby,
         entity.other.attribute-name.jsx,
     </string>
     <key>settings</key>
     <dict>
       <key>foreground</key>
       <string>#ffc600</string><!-- Choose a color -->
       <key>fontStyle</key>
       <string>italic</string>
     </dict>
   </dict>

Make sure you have set "font_face" to "Operator Mono Book" in your Preferences.

To get the same Sublime Text default themes, after selecting Package Resource Viewer: Open Resource choose Color Scheme - Default, then choose your theme and add this to color scheme file:

        {
            "scope": "entity.other.attribute-name.html | entity.other.attribute-name.event.html | entity.other.attribute-name.class.html | entity.other.attribute-name.style.html | entity.other.attribute-name.id.html | entity.other.attribute-name.tag.jade | constant.other.symbol.ruby | entity.other.attribute-name.jsx",
            "font_style": "italic"
        },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment