+122
Kencoxdesign 4 years ago • updated by Juan Gonzalez 1 year ago 31
I'd love to be able to drag an image from the project into the editor and have it generate the appropriate img tag with dimensions. Textmate has this and I really miss it in Sublime 2.
+7
I think with this addition, I can switch over from TextMate to Sublime full time.

Also, this wouldn't be limited to images.  Would like to see drag n' drop support for .css, and .js files.
+1

I'm putting my hand up for this feature too.

-4
This is a crucial addition. Please hurry up with it! I would hate to have to switch back to Textmate.
I've been using Sublime Text 2 for a week, LOVING IT, TWEETED IT! However, I'de like to add my vote for dragging those image assets into the editor as well. It's super useful, I got hooked on it while using TextMate. Could it prompt to include asset path or appropriately propagated insertion based on syntax?

-Thanks, Adam
Please add my vote for this, I used this all the time in TM.
+6
You can use zen-coding plugin for image dimensions in html and css (in css dimensions of bg image). Set caret on image path and press ctrl+alt+shift+m. And for image path you might use Autofilename plugin which you can also use from sublime package manager.
+1 -- this is really important for us that do a lot of HTML. Being able to drag in a JS or CSS file and generate script or link tags would be a big plus as well.
I'd kill for this feature too. Indeed, its the only reason why I've stayed with textmate and not made the switch. I've been using sublime text 2 for about a week now.. add this feature, and you've got me :)

Plus the licence terms are really cool - being able to use it on multiple machines (I run a windows laptop, and mac desktop) is fantastic! Also means I have a consistent editor... use Notepad ++ on windows.
As a webdesigner/developer I used this feature a lot in e-texteditor (for image files as well as css and js files) and it was really handy. Would like to see this in sublime text since this is my current editor of choice. I bought a license a few weeks ago.

Lots of kudos to Jon Skinner for his terrific editor!
+1
This is a must for me too if i am to commit to Sublime Text full time.
+1

 +1 Coming from textmate, this really *is* the missing killer feature.

This definitely would be a great feature, I'm surprised it isn't out there. I think img drag and drop is the most important, but having css and link drag and drop would be awesome as well. I just don't want to spend all my time looking up the dimensions of images. Thanks Sergey for the workaround, I hope a plugin is developed soon!

+1 - for dragging images, js and CSS files from sidebar into editor

+1 for dragging files into editor. That's the only thing missing for me. Now I have to use Coda to put multiple images into my HTML document at once. That gives me each file in a separate line, so in goes Zen Coding to make those a list of anchors, to get an image gallery. But then Sublime Text kills Coda with it's multiple selection feature (also possible in Coda) but so much better – I can select multiple lines with a single keyboard shortcut, then split the selection into multiple lines, select and copy the paths to EACH separate image, and then paste those to the href of each anchor. That's a great speed boost compared to having to manually input all the file names and paths!

So get this feature and I won't look back to Coda.

I would like this functionality too.  I miss it from Coda 2.

+2

I thought, there has to be a way… and found one – first I selected my images in Finder and copied them, checked how many there are, then I switched to Sublime and using ZenCoding I created n images (img*n, tab), then I selected the whole bunch, and made a multiple selection (Cmd+Shift+L) and put the cursors in src="", and pasted the whole thing. Magic :) Then do whatever you want. Not as fast as drag and drop, but close and certainly doable :D

+6

I highly recommend ZenCoding + AutoFileName:

img [Tab] foldername [Enter] filen [Enter] [Tab] alternative text

and you have

<img src="foldername/filename-to-be-tested.png" height="100" width="100" alt="alternative text">

+1

Cool FuzzyFileNav can deal with this issue. Look at "copy as text" → "Tag xxx" in sidebar menu after the package installation. Works fine with a multiple selection (ctrl + shift + mouse click).

I hope sublime team can Implement this feature. this is one of the great features of textmate.

Agreed. This is an extremely important time saver for front end development. I'm so lazy I'll sometimes keep textmate open in parallel with sublime so I can drag/drop copy/paste.

The same for me ! I'm in love with Sublimtext, but drag'n drop still missing…

+1

take this plugin:


https://github.com/graziu/GraziuFuzzyFilePath


i've modified plugin posted by "ynt.corr" - FuzzyFileNav.

now setup your hothey ie. ctrl+o and navigate to the file you want to link to and... simple press enter.

Relative path will be pasted.


I use FuzzyFileNav and I really like it. It is however no replacement for dragging let's say 50 images into an html-document and having their tags auto-inserted including their width and height. Same should go for other external files (js, css, ...).


e-text had this feature and - i hate to say this - dreamweaver has this too (although not for multiple files).

Yeap, i modified this plugin to make inserting relative path to file directly into your code.

Maybe nothing special, but works like a charm.


It's must have for DW migrators ;)


no more remember and manually type file path and name, just hit enter and done :)

Just try my modyfication and check if this is what you need. Maybe its not dragging, but selecting from list is ok for my purpose (set background, source, href to file etc)




I will think about writing drag and drop multiple files later ;)

AWESOME MAN!!! This is like AutoFileName 100x more effective. To my sense it's even better than drag and drop, because we don't need to navigate in the sidebar to find the desired image and not even use the mouse. We can also type the name of the folder above the image and pick from the images on that folder in less than a second. The only improvement I can think of is a way to select multiple files.
THANKS!
Looks like link is dead.
Yes, but you can install from package control or download from here: https://sublime.wbond.net/packages/FuzzyFilePath After installing just type ctrl+option+space anywhere in the code (don't know what it is for windows).
Hi there
Thanks for all your sharing.I have encountered the similar problems.I just want to know that if there is a powerful image generating program which supports to do that directly.Thanks for any suggestion.
I know that this is not exactly asked solution, but I'm using it to easy insert images to code. Not drag&drop, but works for me.

Plugin Auto File Name have fantastic auto completion for relative assets, so combined with Emmet, you can easy insert relative path to existing image with little typing.
I do that, but drag and drop would still be a zillion times easier aqui quicker.