Drag and drop external files into code

Brian Yuen 7 years ago • updated by afields 3 years ago 3
Recent convert from Texmate and really loving ST2.  One thing that I truly miss is the ability to drag and drop image/css/js files from the project sidebar into an open HTML or CSS window.

For example, if I'm editing a html page, dragging an image from the sidebar into the body of the html will produce:

<img src="my_image_file_from_sidebar.jpg" height="100" width="100" />

or if it's a css file

<link rel="stylesheet" type="text/css" media="all" href="css_file.css"> 

Also, select text and then drag an html file from the sidebar to the selected text to produce <a href="dragged.html">selected text</a> - a simple and intuitive way to build links.

The ability to drag and drop a js/img/css file from the sidebar directly into code is a widely accepted method of quickly and efficiently entering these files, with their available parameters, on many of the other top tier code editors. I can't count the number of times I've shown ST and been asked why I don't just drag the file over? It's kinda embarrassing to be extolling the virtues of this software and then have something most other IDEs take for granted not be available.

Also, I forgot to mention how much I LOVE Sublime Text. Long time user of TextMate but I wish I had come over sooner.