Open longbuivan opened 3 weeks ago
This might be a little hard because different languages have different ways to represent an image.
Also pardon me for asking but did you write the description by AI?
In Sublime, there's a plugin that solves this in a simple way:
When an image is copied to the clipboard, pressing Ctrl+V in Sublime saves the image to an "images" folder in the current file's directory, with filenames incrementing as image1.png, image2.png, and so on.
It then inserts ![](images/image1.png)
at the cursor position, displaying the image.
For file types other than .md, it will simply reference the image path. @Rhelvetican this solves the problem of diff file types.
The plugin: https://github.com/robinchenyu/imagepaste/
How to do this on Zed? any pointing?
@intrd By referencing it (in not .md and similar languages), you mean pasting the (presumably relative) path to the image?
For Rust we can use include_bytes!(<path>)
.
@longbuivan If I am understanding this request correctly, you would like to have functionality similar to GitHub when editing a Markdown document, whereby when you paste image data from the clipboard it does the following:
ImagePaste
for ImagePaste.py
) ./ImagePaste/ImagePaste001.png
../ImagePaste/ImagePaste001.png
you'd get ![](./ImagePaste/ImagePaste001.png)
Nifty.
Yes, it's exactly that, @notpeter. I think it's a good idea for an extension, not a Zed built-in feature.
Check for existing issues
Describe the feature
Currently, Zed editor does not support the ability to copy and paste images directly from the clipboard. This feature is essential for improving user workflow and efficiency, enabling seamless interaction with external sources. Implementing clipboard support would allow users to easily transfer text between Zed and other applications, enhancing productivity and flexibility.
If applicable, add mockups / screenshots to help present your vision of the feature
No response