Skip to content

Add MarkdownImagePaste#9347

Open
ricetim wants to merge 1 commit intosublimehq:masterfrom
ricetim:add-markdown-image-paste
Open

Add MarkdownImagePaste#9347
ricetim wants to merge 1 commit intosublimehq:masterfrom
ricetim:add-markdown-image-paste

Conversation

@ricetim
Copy link
Copy Markdown

@ricetim ricetim commented Mar 23, 2026

Package Information

Description

Sublime Text 4 plugin (Windows only) that intercepts Ctrl+V in Markdown files. When the clipboard contains an image, it saves the image to a .images/ subdirectory next to the open file and inserts ![](.images/image_<timestamp>.png) at the cursor. Falls through to normal text paste when no image is present.

  • No external dependencies — pure Python stdlib + ctypes
  • No subprocess spawning
  • Configurable image_dir and prompt_alt_text settings
  • Multi-cursor support

Checklist

  • Package name is spelled correctly and follows naming conventions
  • Repository is public
  • v1.0.0 semver tag exists on the repository
  • Plugin loads under ST4 Python 3.8 runtime (.python-version present)
  • Entry is in alphabetical order in repository/m.json

Sublime Text 4 plugin (Windows only) that intercepts Ctrl+V in markdown
files, saves clipboard images to .images/, and inserts ![]() syntax.
No external dependencies — pure Python stdlib + ctypes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kaste
Copy link
Copy Markdown
Contributor

kaste commented Mar 23, 2026

In spirit probably the same as https://packages.sublimetext.io/packages/ImagePaste for which I have the running fork https://github.com/kaste/imagepaste for ST4/py38.

Please note that your scaffold is not what Package Control expects as everything has to be in the root folder.

@ricetim
Copy link
Copy Markdown
Author

ricetim commented Mar 24, 2026

Please note that your scaffold is not what Package Control expects as everything has to be in the root folder.

In spirit probably the same as https://packages.sublimetext.io/packages/ImagePaste for which I have the running fork https://github.com/kaste/imagepaste for ST4/py38.

Please note that your scaffold is not what Package Control expects as everything has to be in the root folder.

Updated the directory structure.

It does look like our two extensions are quite similar. I created this one because the package you forked wasn't doing everything I wanted, and was tripping my work PC 3rd party software alarms.

@kaste
Copy link
Copy Markdown
Contributor

kaste commented Mar 29, 2026

Hm, if is Windows only you must state that here in entry. The key is platform/platforms. You'll find it.

Reading the code is tripping my AI-slop/nobody maintains this alarm.

In a nutshell this is

from PIL import ImageGrab
import sublime_plugin

class MarkdownImagePasteCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        img = ImageGrab.grabclipboard()
        if not img:
            self.view.run_command('paste')
            return
        img.save(f'.images/image_{time.time()}.png')
        # insert markdown link

From my understanding, the ctypes assignments do leak. I'm not sure this is bad in a practical sense, -- will a different computer/user have a different, contradictory opinion on these? -- but in a factual.

Anyway, the entry here must be fixed.

@braver braver added the feedback provided The changes and package have been seen by a reviewer label Apr 8, 2026
@braver
Copy link
Copy Markdown
Collaborator

braver commented Apr 8, 2026

Please use the PR template.

I'm getting really tired of these AI generated pull requests not following our very simple guidelines....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feedback provided The changes and package have been seen by a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants