1

I would like to write a plugin which will be triggered at paste from system clipboard if it contains image data. Is it feasible to do this with scripting? My preference is to write in Python, using neovim is also possible. The image would be then saved to file and its name inserted into the edited text.

  • 1
    For now your question is too broad to be kept open: It involves how to trigger an action at pasting, detecting that the data in the clipboard is an image (which probably shouldn't be Vim's job), how to save the image to a file (which isn't Vim's job neither), how to get the name of the new file, etc... So I will close the question and you should instead ask for help for a precise problem you'll have when implementing your plugin. – statox Jul 10 at 11:54
  • 1
    @statox okay, you're right :) – eudoxos Jul 10 at 12:07
  • This is an almost exact duplicate of vi.stackexchange.com/questions/14114/… – Rich Jul 11 at 20:11
  • 1
    FWIW, I got halfway through turning my answer to that question into a plugin. It's functional, but I ran out of steam before implementing all the features I was planning so it's never been released. I'm still planning to pick it development again one day, so I hope you don't beat me to market! – Rich Jul 11 at 20:17
  • 1
    @Rich the dupe is well spotted, thanks! I cooked something up using python (in vim) and xclip now. Please feel free to close the question. – eudoxos Jul 12 at 9:19

Browse other questions tagged or ask your own question.