Highlight the jQuery $ variable in Sublime Text 3 (build 3103)

只愿长相守 提交于 2019-12-02 07:48:42

Until the unpaid/non-dev Sublime Text 3 is updated >= build 3106, follow these instructions to theme your $ variable in JavaScript or otherwise allow updated themes to function properly.

  1. On your computer, go to Sublime Text 3\Data\Packages and make a new folder named "JavaScript", exactly that.

  2. Visit https://github.com/sublimehq/Packages/blob/master/JavaScript/JavaScript.sublime-syntax

  3. Copy that text, save as JavaScript.sublime-syntax in your new JavaScript folder. This will update the grammar to accept $ as its own scope.

  4. You can now target variable.other.dollar.only.js and punctuation.dollar.js

Modifying Your Theme

Add this to your favorite theme if it hasn't been updated! Change the foreground to your liking.

<dict>
    <key>name</key>
    <string>jQuery $</string>
    <key>scope</key>
    <string>punctuation.dollar.js</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#b3935cff</string>
    </dict>
</dict>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!