Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I read RSS in VIM?

Tags:

vim

rss

Would like to read RSS in VIM, but I haven't found a plugin out there.

You guys have any idea?

like image 338
Luis Avatar asked Dec 31 '22 04:12

Luis


2 Answers

I just used feedparser.py in http://www.vim.org/scripts/script.php?script_id=2147 to get a trac servers timeline view. You need to have it installed and +python in your vim install. Although there probably other language libraries you can try if you're a ruby/perl guy.

A bit of vim script knowledge and you're there (check out the link above and steal what you need). And feel free to do whatever you damn well please with your own vim install :)

Edit: rather than dredge through that code... heres a condensed version for your vimrc you can expand on and make prettier

fun MyFeed(feed)
split
enew
set buftype=nofile
python b = vim.current.buffer
python import re
python import feedparser;f = feedparser.parse(vim.eval('a:feed'))
python for i in f['items']: b.append('%s {{{1 %s' % (str(i.title), str(i.link)));
            \b.append(str(re.sub(r'<[^>]*?>', '',i.summary_detail.value)).split("\n"))
setlocal  textwidth=120
norm gggqGgg
set foldmethod=marker

endfun
com VimRssFeed call MyFeed("http://stackoverflow.com/feeds/question/566656")
com Slashdot call MyFeed("http://rss.slashdot.org/Slashdot/slashdot")
com MyStack call MyFeed("http://stackoverflow.com/feeds/user/59592")

Make sure you have http://www.feedparser.org/ installed

like image 95
michael Avatar answered Jan 01 '23 18:01

michael


Is there a particular reason it needs to be inside vim? There are multiple full-featured console RSS readers available such as newsbeuter.

like image 29
Chad Birch Avatar answered Jan 01 '23 17:01

Chad Birch