vim+markdown proceed image in clipboard

2017-11-05 18:10:50

I have a usecase with my vim+markdown

I have an image in clipboard and I want to paste it in my document as [](img/image1.png)

Instead of first coping it in that directory I want it to be done with single p in vim. So it hooks p, checks if I edit .md, saves my image to img/image1.png location while inserting [](img/image1.png) to file.

Is it possible with vim?

I use macos and terminal vim