Open fourpastmidnight opened 9 years ago
Found the solution. Apparently, the current snippets.json
file found at the official Emmet github repository has the following abbreviation:
"script": "<script !src=\"\">"
An older version of this file (supplied with my version of the Notepad++ Emmet plugin) contains the following rule, instead:
"script": "<script>"
Using this rule, it allows script[src="myFile.js"]
to be expanded to <script src="myFile.js"></script>
.
Also, something that is more handy (but not part of the official Emmet snippets.json
is the following abbreviation which would replace the existing one:
"script:src": "<script src=\"{$1:script}.js\">"
Then, using script:src
would expand to <script src="script.js"></script>
, with script
highlighted, awaiting your filename replacement.
For now, you can place this in your own snippets-*.json
file. I found on Stack Overflow that in order to specify the extensions directory for this plugin on Windows machines, you need to replace all backslashes in the path with forward slashes (e.g. C:\MyExtensions\emmet
would become C:/MyExtensions/emmet
).
When specifying the following emmet abbreviation:
it translates it to simply: