Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code - Drag image from Explorer pane into markdown file and drop as path

In Visual Studio Code, from the Explorer pane, how can I drag a PNG file from my images folder and drop it in place in a markdown file, so that VS Code inserts the path to the dropped image?

Currently, VS Code just opens the image in a new tab.

I've reviewed the suggested answers, as well as the available markdown extensions, with no luck finding an answer.

Any assistance is appreciated!

like image 459
Chris Blocher Avatar asked Nov 01 '17 12:11

Chris Blocher


People also ask

How do you drag and drop an image in VS Code?

Quickly insert images and file links by dragging and dropping. To start, drag a file from VS Code's explorer over your Markdown code and then hold down Shift to start dropping it into the file. The preview cursor shows where it will be inserted when you drop it.

How do I add an image to Markdown VS Code?

Smartly paste in Markdown by pressing 'Ctrl+Alt+V' ('Cmd+Alt+V' on Mac) or Markdown Paste command. If you paste an image, the extension will create an new file for the image and insert link code to Markdown.

How do you move an image in VS Code?

Go to vscode then right click on a folder in which you want your image and then choose reveal in file explorer. After that you can simply copy your image into the vs code folder.

How do I add an image to a Markdown file?

Images can be added to any markdown page using the following markdown syntax: ![ alt text for screen readers](/path/to/image. png "Text to show on mouseover") .


2 Answers

I've looked it up everywhere too, bharath is entirely correct, for now you could just use right click -> copy path and paste it, It's quite tedious compared to a drag and drop solution, but Hopefully there would be an asset for that, If someone made this: https://marketplace.visualstudio.com/items?itemName=mushan.vscode-paste-image

definitely something similar for just dragging and dropping would be possible

like image 57
Omar Avatar answered Sep 22 '22 14:09

Omar


It seems like this is not possible yet in vscode as compared to visual studio. There seems to be a pending feature request on their GitHub issues page (link below) which was opened long back and not yet closed.

https://github.com/Microsoft/vscode/issues/5240

like image 23
bharath Avatar answered Sep 19 '22 14:09

bharath