Annoying google drive share link issue if you just copy/paste...
Problem
Recently getting more and more lazy to organize images through blog folders. I know it has a lot of neat image caching/optimization features. Link to Google Drive seems to be a convenient way for me sometimes.
Yet, haunted by this issues of converting:
to:
Solution
Put this in your Ultisnip:
snippet gimg "google image"
![${0:${VISUAL}}](${1:`!v
substitute(getreg("*"), "https://drive.google.com/file/d/\\(.*\\)/view.*", "https://drive.google.com/uc\\?export=view\\&id=\\1", "g")
`})
endsnippet
Then it grab the register/clipboard and return the correct google drive link as markdown image. But it's essentially just vim command. Feel free to tailor the line after !v
to your need.