public
Last active

  • Download Gist
reddit.vim
VimL
1 2 3 4 5 6 7 8 9 10 11 12 13
function! s:reddit()
tabnew
let res = webapi#json#decode(webapi#http#get('http://www.reddit.com/r/vim.json').content)
let lines = []
for item in res.data.children
call add(lines, "* " . item.data.title)
call add(lines, " " . item.data.url)
let lines += [""] + map(split(item.data.selftext, "\n"), "' '.v:val") + [""]
endfor
call setline(1, lines)
match Title /^\* .*/
endfunction
command! Reddit call s:reddit()

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.