To access the ZenCoding plugin file, go to Packages/ZenCoding/sublimezenplugin.py
Immediately after the section labeled `#########CONSTANTS#########, add the following code:
HTML = 'text.html - source'
XML = 'text.xml'
Include the following code as well:
JS = 'source.js'
Next, locate the part of the file that reads:
ZEN_SCOPE = ', '.join([HTML, XML, CSS])
Change the code to:
ZEN_SCOPE = ', '.join([HTML, XML, CSS, JS])
With this change, Zencoding will be activated in JS files. Do keep in mind that Zencoding will always be active in JavaScript files. If you wish to limit the scope to specific areas, such as strings in JS, you can adjust the scope. The scope for JS strings includes string.quoted.double.js
for double quotes and string.quoted.single.js
for single quotes. These can be added to the JS = ...
line. Feel free to experiment with the scope settings to suit your preferences. For more information on scopes, refer to the documentation available here:
Additionally, to view the current scope directly under the cursor, press ctrl+alt+shift+p
on Windows/Linux or alt+command+p
on OSX.