Minor Update to Vim Gist Plugin for New GitHub API
Today I was trying to use the Gist Vim plugin and noticed that it was a bit broken. In fact, it wasn't even close to working. I was getting HTML redirection messages, and that's not good. So I decided to take a few minutes and see if I could get it back working again. I looked at the site and noticed that it hadn't been updated recently, so it was going to be up to me.
What I figured was that it was in the URL for getting the Gist from GitHub. That's in this code:
function! s:GistGet(user, token, gistid, clipboard) let url = 'https://gist.github.com/'.a:gistid.'.txt' let winnum = bufwinnr(bufnr('gist:'.a:gistid))
and after a bit of time reading the GitHub API site, and fiddling around with the URL, I was able to see that the correct URL is really:
function! s:GistGet(user, token, gistid, clipboard) let url = 'https://raw.github.com/gist/'.a:gistid let winnum = bufwinnr(bufnr('gist:'.a:gistid))
So I changed that in my copies, and I'm good to go. For a while.