How to paste the screenshot from clipboard gracefully in VS Code, VS Code will copy this image when the current specified directory and rename it according to the time
The built-in markdown plugin has a markdown.experimental.copyFiles.destination
setting, but there is no documentation explaining how to configure it, and using the'Paste Image 'plugin for example has no effect
Note: Since VS Code 1.79, the setting is no longer experimental, and is called markdown.copyFiles.destination
(source).
First you need to enable editor.experimental.pasteActions.enabled
("Enable/disable running edits from extensions on paste."). Then you can set markdown.experimental.copyFiles.destination
configuration according to its documentation:
Defines where files copied created by drop or paste should be created. This is a map from globs that match on the Markdown document to destinations.
The destinations may use the following variables:
${documentFileName}
— The full filename of the Markdown document, for example: readme.md.${documentBaseName}
— The basename of Markdown document, for example: readme.${documentExtName}
— The extension of the Markdown document, for example: md.${documentDirName}
— The name of the Markdown document's parent directory.${documentWorkspaceFolder}
— The workspace folder for the Markdown document, for example: /Users/me/myProject. This is the same as${documentDirName}
if the file is not part of a workspace.${fileName}
— The file name of the dropped file, for example: image.png.
For example, to paste any pasted images in the same directory as the markdown file you are pasting into, use:
"markdown.experimental.copyFiles.destination": {
"**/*": "${documentDirName}/"
}