Open JosiahParry opened 9 months ago
Here is my solution to paste an image from clipboard in Visual Studio Code, hope it helps:
"files.associations": {
"*.qmd": "markdown"
}
Now, VS Code recognizes the .qmd files as .md files, so that you can follow the instruction here to paste an image from clipboard for .md files: https://stackoverflow.com/questions/75831497/how-can-i-paste-images-into-my-markdown-files-in-vs-code
In VS Code Settings UI, to set the pasted image to store in ./images (this is also provided in the link above):
Nice tip. But unfortunately it has the side of effect of disabling some of the quarto highlighting.
Nice tip. But unfortunately it has the side of effect of disabling some of the quarto highlighting.
Thank you very much for your response. I've discovered another way to achieve this without modifying the settings in settings.json
.
We can find the Select Language Mode
option at the bottom-right of VS Code window:
Then we can search and chose Markdown
when we need to paste images from the clipboard:
Then switch back to Quarto
while typing:
While this method may still be somewhat inconvenient, it's faster than saving the image and importing it manually.
@minh711 have you tried the other way around - using $documentExtName
to associate Markdown settings with .qmd
extension?
Looks like I've made the same request in the wrong repo: https://github.com/quarto-dev/quarto-cli/discussions/8962
P.S. I wish Quarto used just .md
. Is it a matter of branding? Attempted vendor lock-in?
I quite love that I can paste an image from my clipboard into the visual editor and it saves the image into ./images. But I cannot do this using the source editor. I would reallyyyy like to! Mostly because I do not like how the visual editor edits my file and adds additional spaces between lines.
https://github.com/quarto-dev/quarto-cli/discussions/7623#discussioncomment-7601035