Sublime Forum

Drag and drop image to code

#1

Love this editor more than I’ve ever loved any other. (and in the past 12 years, I have tried them all; pico, vim, emacs, BBcode, dreamweaver, Textwrangler, Notepad++, Textpad, Visual Studio, Aptana/Eclipse, Netbeans, Espresso, Coda, Textmate… and a few other random ones in there as a trial basis.

One feature I’d really love to see is to drag and drop an image from the sidebar into the code window and have its HTML attributes set.

Use case: User clicks on images folder to expand it. User drags foo.jpg to code view. The following markup is generated:

foo

I did use this in Textmate once I found out that the feature existed… but I’ve moved on to the next level and I have no interest in going back!!! Long live Sublime!!!

1 Like

A command to paste a image from clipboard to the code?
#2

I would like that same thing. I am still using php designer just because it has this feature. I would switch to subllime instantly when it would have that feature also.

I would also like that for css and javascript files. If the user grabs the css file in sidebar and drags it to html the following code is generated . If he drags the css file to the place where the tabs are it will open the file.

Is it maybe allready possible for images to be drag and drop? That’s all that matters to me in code editor. Thank you

0 Likes

#3

Noone answered to this topic in last 5 months. Support sucks here!

0 Likes

#4

This is a feature request, not a support request.

This feature doesn’t exists and I don’t think that it’s possible to drag’n’drop files from the sidebar yet (need some new API methods).
However it could be probably possible to add an entry in the context menu of the sidebar to do what you want.
A plugin using something like PIL (http://www.pythonware.com/products/pil/) or even a simple file parser can extract the size of the image and insert the data in the cursor position.

0 Likes

#5

First of all, support here does NOT suck… not even slightly.

Secondly, Tito has created a great plugin for performing a workaround for this feature. It’s one step more, but it works well:

viewtopic.php?f=5&t=3331&hilit=tito

Check out his sidebar enhancements.

-nobleach

0 Likes

#6

I too really want this feature. Looking up an images width and height is just an annoying, time consuming thing to do.

Until I can figure out how to do this in Sublime Text, I create a little tool to do this for me:

http://imgta.gs/

As in an editor, you simply drag and drop the images from your computer into this website, and it spits out the image tags. Best of all, it doesn’t actually upload them, it uses HTML5 to figure out the dimensions, so it’s instant.

Hope this helps someone!

0 Likes

#7

+1 for this feature. Coming from TextMate, I find this really handy when I need it.

0 Likes

#8

+1

Would also be nice to have the ability to slightly customize that script. So, for instance, if you wanted to have the link be /images vs images or if you wanted to prefix all links with /assets/, etc.

0 Likes

#9

+1 for this feature as well. Also, instead of opening gibberish when selecting an image file, opening an image preview instead would be a nice feature too.

0 Likes

#10

+1 for this

also Textmate lets you drag images into css too which is really handy when you’re putting background images in

It doesn’t seem like this would be too hard to add and it’d be a big time saver for users!

brent
@

0 Likes

#11

+1

Additionally it would be nice if you could config this to use either file path or base64.

0 Likes

#12
  • 1 for this feature as well, would be supper beneficial, it’s the reason I still keep coda around.
0 Likes

#13

+1, I need this feature too… I can’t handle any other method for this, I cry each time I have to do one :frowning:

0 Likes

#14

+1 Yes Please

0 Likes

#15

+1

currently looking into switching to sublime from Textmate and YES, this is what I instantly missed big time!

0 Likes

#16

Just keeping this feature request alive!

0 Likes

#17

I agree this would be an excellent feature to have.

But not just for images, but also for CSS and JS files.

0 Likes

#18

Now, if you all would raise your voices here

sublimetext.userecho.com/topic/ … r-img-tag/

that would be swell. But I guess most of you did that already.

0 Likes

#19

10 years later… still not possible :smiley:

0 Likes