Search code examples
javascriptcsswebstorm

Shortcut to create automatic tags for JS and CSS files in my project in WebStorm


WebStorm is packed with nice features and shorcuts, but I'm not able to find a quick way to add JavaScript or CSS file to my HTML page.

I have a new project, I create a file index.html and a script.js (or it can be a library I downloaded or a CSS file). Now I'd like to do something like drag and drop the script.js file directly in my index.html and automatically see generated:

<script src="script.js"></script>

At moment I'm doing it with Emmet (script:src + <tab>).

I know it's not much to write, but starting a new project maybe you want to include a bunch of libraries that you downloaded and it's bit annoying to do this manually. And I wanted something like I select the files I want to include and I just drop them in my html file.

So I thought WebStorm would have a smart way to do that.

Maybe this functionality is already there and I'm just not able to find it.


Solution

  • That's not currently supported and not yet planned for any specific future version.

    In any case:

    Watch these tickets (star/vote/comment) to get notified on progress.


    I may only suggest to create a custom Live Template and use it to possibly speed up such insertion. Typing s[TAB] (where s is your abbreviation for such live template) is still faster than that Emmet sequence.