79494199

Date: 2025-03-08 10:02:46
Score: 1.5
Natty:
Report link

How to Insert Images in VSCode Like Typora?

Desired Effect

Implement Typora's Copy image to ./assets functionality in VSCode:

enter image description here

Install Markdown Image Plugin

enter image description here

Linux User Configuration

Linux users must install xclip.

Ubuntu

sudo apt install xclip

CentOS

sudo yum install epel-release.noarch
sudo yum install xclip

Remote Mode

If you want to use in the Remote Mode, please set remote.extensionKind like this:

"remote.extensionKind": {
  "hancel.markdown-image": [
    "ui"
  ]
}

And if you want to save image in your remote workplace, you must use SFTP upload method. Local couldn't use in Remote Mode.

Through actual testing, in remote mode, you need to configure remote.extensionKind, then use the Local configuration in the remote window. See the next section for specific implementation.

Plugin Configuration

❗️ Taking remote mode as an example. The configuration method is the same in local mode.

enter image description here

enter image description here

Filename: img_${YY}${MM}${DD}-${HH}${mm}${ss}${mss}.png

img_${YY}${MM}${DD}-${HH}${mm}${ss}${mss}

enter image description here

enter image description here

Change path to: ./assets

This way, pressing the shortcut alt+shift+v in markdown file will paste images to ./assets/...png.

Reasons:
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): How to In
  • Low reputation (1):
Posted by: Sylvan Ding