A Sublime Text 4 plugin for Windows that pastes clipboard images directly into Markdown files.
Press Ctrl+V while editing a Markdown file:
- Clipboard has an image → saves it to
.images/next to your file and insertsat the cursor - Clipboard has text → normal paste, unchanged
Works with screenshots (Win+Shift+S, Snipping Tool) and images copied from browsers or other applications.
- Sublime Text 4 (build 4000+)
- Windows
- Open the Command Palette (
Ctrl+Shift+P) - Run
Package Control: Install Package - Search for
MarkdownImagePaste
Copy the MarkdownImagePaste/ folder into your Sublime Text packages directory:
%APPDATA%\Sublime Text\Packages\
Important: Make sure to include the
.python-versionfile. ST4 uses it to select Python 3.8; omitting it will cause import errors.
Open Preferences → Package Settings → MarkdownImagePaste → Settings:
{
// Directory where images are saved (relative to the open Markdown file)
"image_dir": ".images",
// When true: cursor lands between [] after paste so you can type alt text
// When false (default): cursor lands after the closing )
"prompt_alt_text": false
}Note:
image_diris used as a path component relative to your Markdown file. Do not set it to an absolute path or a value containing...
Images are saved as image_<unix_ms>.png (e.g. image_1742749200123.png) inside the configured image_dir, relative to the open file. The directory is created automatically if it doesn't exist.
Supported clipboard formats (in priority order):
- CF_PNG — already a PNG, saved directly
- CF_DIB / CF_DIBV5 — raw Device Independent Bitmap, converted to PNG using pure Python (
struct+zlib)
- No subprocess spawning (Carbon Black / endpoint-security safe)
- No external dependencies — pure Python stdlib +
ctypes - Multi-cursor aware: inserts at each cursor position
MIT